Fingerprint android auth for react-native (android only).
Starts authentication. Returns a Promise.
Will check if android.permission.USE_FINGERPRINT
is granted to this app.
Determine if there is at least one fingerprint enrolled.
Determine if fingerprint hardware is present and functional.
npm i react-native-fingerprint --save
Don't forget to add the permission to your manifest:
android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example">
+ <uses-permission android:name="android.permission.USE_FINGERPRINT" />
Run react-native link
after npm install.
android/app/build.gradle
dependencies {
+ compile project(path: ':react-native-fingerprint')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
android/settings.gradle
include ':app'
+include ':react-native-fingerprint'
+project(':react-native-fingerprint').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fingerprint/android')
android/app/src/main/java/com.your.package/MainApplication.java
import com.facebook.react.ReactApplication;
+ import che.rn.fingerprint.FingerPrintPackage;
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
- new MainReactPackage()
+ new MainReactPackage(),
+ new FingerPrintPackage()
);
}
Improve docs, add example