@nmh/react-native-device-auth
v1.0.5
Published
React Native KeyguardManager And LocalAuthentication Lib (Android and Ios)
Downloads
26
Readme
react-native-device-auth
React Native KeyguardManager And LocalAuthentication Lib (Android and Ios)
Installation
npm install @nmh/react-native-device-auth
Android
- 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" />
IOS
- 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>
Usage
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))
})
}
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library