This library is the replica of expo-local-authentication source. It can be used as standalone library in case someone does not wants to configure expo environment.
$ npm install react-native-local-authenticate --save
RN60 above please use
react-native-local-authenticate
V1 and above
iOS Prerequisite: Please make sure
CocoaPods
is installed on your system
- Add the following to your `Podfile` -> `ios/Podfile` and run pod update:
use_native_modules!
pod 'RNLocalAuthenticate', :path => '../node_modules/react-native-local-authenticate/ios'
Please add below permission to your app AndroidManifest
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.USE_BIOMETRIC"/>
RN60 below please use
react-native-local-authenticate
V.0.*
$ react-native link react-native-local-authenticate
Android
build.gradle
buildscript {
repositories {
jcenter()
maven { url "https://maven.google.com" }
...
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url "https://maven.google.com" }
...
}
}
Note
- Android SDK 27 > is supported
import { RNLocalAuthenticate } from 'react-native-local-authenticate'
RNLocalAuthenticate.HasHardware().then((hasHardware) => {
})
RNLocalAuthenticate.IsEnrolled().then((isEnrolled) => {
})
RNLocalAuthenticate.SupportedAuthenticationTypes().then((isEnrolled) => {
})
RNLocalAuthenticate.Authenticate('reason').then((isEnrolled) => {
})
Prop | Type | Default | Note |
---|---|---|---|
HasHardware:Promise |
bool |
Used to check for hardware capability | |
IsEnrolled:Promise |
bool |
Used to check enrolled for FaceID/TouchID | |
Authenticate |
bool |
Used to authenticate user using FaceId/TouchID |
Prop | Type | Default | Note |
---|---|---|---|
CancelAuthenticate |
`` | true | Used to cancel ongoing authentication |
Prop | Type | Default | Note |
---|---|---|---|
SupportedAuthenticationTypes |
array |
Used to check supported authentication types |
Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.
If you are using this library in one of your projects, add it in this list below. āØ
This library is provided under the Apache 2 License.
RNAppTour @ prscX
I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
If you're feeling especially charitable, please follow prscX on GitHub.
Thanks! ā¤ļø
prscX.github.io
</ Pranav >