简体   繁体   English

检查设备是否具有通过 React Native 配置的锁定方法

[英]Check if a device has a lock method configured via React Native

Problem问题

We have to check whether a mobile phone / tablet has any locking functionality (PIN, Pattern, Biometrics, ...) enabled.我们必须检查手机/平板电脑是否启用了任何锁定功能(PIN、图案、生物识别等)。 If nothing was set, then the app shouldn't run.如果未设置任何内容,则应用程序不应运行。

Is there any way to do this via React Native ?有没有办法通过React Native做到这一点? I have found - on Android - a Keyguard Manager , which seems to include this functionality, but couldn't find anything in the React Native docs about it.我在 Android 上找到了一个 Keyguard Manager ,它似乎包含此功能,但在React Native文档中找不到任何关于它的内容。

So I fear my only option is to implement this myself via native modules?所以我担心我唯一的选择是通过本机模块自己实现这个? And is there even something similar like this on iOS ? iOS上是否还有类似的东西?

You can try the following package device-info您可以尝试以下 package 设备信息

and use isPinOrFingerprintSet() method.并使用 isPinOrFingerprintSet() 方法。 I'm not sure, but that's what I read!我不确定,但这就是我读到的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM