@exodus/react-native-biometrics 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
ADDED
|
@@ -28,6 +28,17 @@ public final class RNBiometricsModule extends ReactContextBaseJavaModule {
|
|
|
28
28
|
return NAME;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
@ReactMethod
|
|
32
|
+
public void isSupported(Promise promise) {
|
|
33
|
+
try {
|
|
34
|
+
BiometricManager biometricManager = BiometricManager.from(context);
|
|
35
|
+
int canAuthenticate = biometricManager.canAuthenticate(BiometricManager.Authenticators.BIOMETRIC_STRONG);
|
|
36
|
+
promise.resolve(canAuthenticate == BiometricManager.BIOMETRIC_SUCCESS);
|
|
37
|
+
} catch (Exception e) {
|
|
38
|
+
promise.reject(e);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
@ReactMethod
|
|
32
43
|
public void authenticate(String title, String subtitle, String cancelButtonText, Promise promise) {
|
|
33
44
|
context.getCurrentActivity().runOnUiThread(new Runnable() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/react-native-biometrics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React Native Biometrics",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"ios",
|
|
11
11
|
"cpp",
|
|
12
12
|
"index.js",
|
|
13
|
+
"CHANGELOG.md",
|
|
13
14
|
"*.podspec",
|
|
14
15
|
"!ios/build",
|
|
15
16
|
"!android/build",
|
|
@@ -42,9 +43,6 @@
|
|
|
42
43
|
"url": "https://github.com/ExodusMovement/react-native-biometrics/issues"
|
|
43
44
|
},
|
|
44
45
|
"homepage": "https://github.com/ExodusMovement/react-native-biometrics#readme",
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"registry": "https://registry.npmjs.org/"
|
|
47
|
-
},
|
|
48
46
|
"peerDependencies": {
|
|
49
47
|
"react": ">=16.8.0",
|
|
50
48
|
"react-native": ">=0.57.0"
|
|
@@ -3,7 +3,10 @@ import { NativeModules } from 'react-native';
|
|
|
3
3
|
const AndroidBiometrics = NativeModules.Biometrics;
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
|
|
7
|
-
return AndroidBiometrics.
|
|
6
|
+
isSupported: async () => {
|
|
7
|
+
return AndroidBiometrics.isSupported();
|
|
8
|
+
},
|
|
9
|
+
authenticate: async ({ title, subtitle, cancelButtonText }) => {
|
|
10
|
+
return AndroidBiometrics.authenticate(title, subtitle, cancelButtonText);
|
|
8
11
|
}
|
|
9
12
|
}
|
package/src/Biometrics.ios.js
CHANGED