React native android fingerprint
npm install react-native-fingerprintFingerprint android auth for react-native (android only).
#### .authenticate():Promise
Starts authentication.
Returns a Promise.
#### .hasPermission(): Promise
Will check if android.permission.USE_FINGERPRINT is granted to this app.
#### hasEnrolledFingerprints(): Promise
Determine if there is at least one fingerprint enrolled.
#### isHardwareDetected(): Promise
Determine if fingerprint hardware is present and functional.
npm i react-native-fingerprint --saveDon't forget to add the permission to your manifest:
android/app/src/main/AndroidManifest.xml
``diff`
+
react-native link$3
Run after npm install.
android/app/build.gradle`diff`
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`diff`
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`diff`
import com.facebook.react.ReactApplication;
+ import che.rn.fingerprint.FingerPrintPackage;`diff``
@Override
protected List
return Arrays.
- new MainReactPackage()
+ new MainReactPackage(),
+ new FingerPrintPackage()
);
}