React Native KeyguardManager And LocalAuthentication Lib (Android and Ios)
npm install @nmh/react-native-device-auth
- Insert the following lines
android/app/src/AndroidManifest.xml
:<uses-permission android:name="android.permission.USE_FINGERPRINT" /> <uses-permission android:name="android.permission.USE_BIOMETRIC" />
- Insert the following lines
ios/project/info.plist
:<key>NSFaceIDUsageDescription</key> <string>Enabling Face ID allows you quick and secure access to your account.</string>
import RNDeviceAuth from '@nmh/react-native-device-auth';;
// ...
const LABEL = 'This is a secure area, please authenticate yourself';
authenticate () {
return new Promise((resolve,reject)=>{
RNDeviceAuth.authenticate({reason:this._LABEL})
.then((status:any)=>console.log(status))
.catch((error:any)=>console.log(error))
})
}
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library