Skip to content

naingmahar/react-native-device-auth

Repository files navigation

react-native-device-auth

React Native KeyguardManager And LocalAuthentication Lib (Android and Ios)

Installation

npm install @nmh/react-native-device-auth

Android

  1. 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

  1. 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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published