Check if a device has a lock method configured via React Native

1.4k views Asked by At

Problem

We have to check whether a mobile phone / tablet has any locking functionality (PIN, Pattern, Biometrics, ...) enabled. If nothing was set, then the app shouldn't run.

Is there any way to do this via 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.

So I fear my only option is to implement this myself via native modules? And is there even something similar like this on iOS?

1

There are 1 answers

0
FaysalB On BEST ANSWER

You can try the following package device-info

and use isPinOrFingerprintSet() method. I'm not sure, but that's what I read!