@exodus/react-native-biometrics 0.1.1 → 0.2.1
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/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2025 Exodus Movement, Inc
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
5
|
of this software and associated documentation files (the "Software"), to deal
|
|
6
6
|
in the Software without restriction, including without limitation the rights
|
|
@@ -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.1",
|
|
4
4
|
"description": "React Native Biometrics",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,12 @@
|
|
|
31
31
|
"keywords": [
|
|
32
32
|
"react-native",
|
|
33
33
|
"ios",
|
|
34
|
-
"android"
|
|
34
|
+
"android",
|
|
35
|
+
"biometrics",
|
|
36
|
+
"fingerprint",
|
|
37
|
+
"face-id",
|
|
38
|
+
"touch-id",
|
|
39
|
+
"authentication"
|
|
35
40
|
],
|
|
36
41
|
"repository": {
|
|
37
42
|
"type": "git",
|
|
@@ -44,7 +49,7 @@
|
|
|
44
49
|
},
|
|
45
50
|
"homepage": "https://github.com/ExodusMovement/react-native-biometrics#readme",
|
|
46
51
|
"publishConfig": {
|
|
47
|
-
"
|
|
52
|
+
"access": "public"
|
|
48
53
|
},
|
|
49
54
|
"peerDependencies": {
|
|
50
55
|
"react": ">=16.8.0",
|
|
@@ -3,6 +3,9 @@ import { NativeModules } from 'react-native';
|
|
|
3
3
|
const AndroidBiometrics = NativeModules.Biometrics;
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
+
isSupported: async () => {
|
|
7
|
+
return AndroidBiometrics.isSupported();
|
|
8
|
+
},
|
|
6
9
|
authenticate: async ({ title, subtitle, cancelButtonText }) => {
|
|
7
10
|
return AndroidBiometrics.authenticate(title, subtitle, cancelButtonText);
|
|
8
11
|
}
|
package/src/Biometrics.ios.js
CHANGED