@exodus/react-native-biometrics 0.2.0 → 0.3.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/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
|
|
@@ -40,11 +40,25 @@ public final class RNBiometricsModule extends ReactContextBaseJavaModule {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
@ReactMethod
|
|
43
|
-
public void authenticate(String title, String subtitle, String cancelButtonText, Promise promise) {
|
|
43
|
+
public void authenticate(String title, String subtitle, String cancelButtonText, boolean fallbackToPasscode, Promise promise) {
|
|
44
44
|
context.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
45
45
|
@Override
|
|
46
46
|
public void run() {
|
|
47
47
|
try {
|
|
48
|
+
int authenticators = fallbackToPasscode
|
|
49
|
+
? BiometricManager.Authenticators.BIOMETRIC_STRONG | BiometricManager.Authenticators.DEVICE_CREDENTIAL
|
|
50
|
+
: BiometricManager.Authenticators.BIOMETRIC_STRONG;
|
|
51
|
+
|
|
52
|
+
BiometricPrompt.PromptInfo.Builder promptInfoBuilder = new BiometricPrompt.PromptInfo.Builder()
|
|
53
|
+
.setAllowedAuthenticators(authenticators)
|
|
54
|
+
.setTitle(title)
|
|
55
|
+
.setSubtitle(subtitle);
|
|
56
|
+
|
|
57
|
+
// Negative button text cannot be set when DEVICE_CREDENTIAL is allowed.
|
|
58
|
+
if (!fallbackToPasscode) {
|
|
59
|
+
promptInfoBuilder.setNegativeButtonText(cancelButtonText);
|
|
60
|
+
}
|
|
61
|
+
|
|
48
62
|
new BiometricPrompt(
|
|
49
63
|
(FragmentActivity) context.getCurrentActivity(),
|
|
50
64
|
ContextCompat.getMainExecutor(context),
|
|
@@ -61,14 +75,7 @@ public final class RNBiometricsModule extends ReactContextBaseJavaModule {
|
|
|
61
75
|
promise.resolve(true);
|
|
62
76
|
}
|
|
63
77
|
}
|
|
64
|
-
).authenticate(
|
|
65
|
-
new BiometricPrompt.PromptInfo.Builder()
|
|
66
|
-
.setAllowedAuthenticators(BiometricManager.Authenticators.BIOMETRIC_STRONG)
|
|
67
|
-
.setTitle(title)
|
|
68
|
-
.setSubtitle(subtitle)
|
|
69
|
-
.setNegativeButtonText(cancelButtonText)
|
|
70
|
-
.build()
|
|
71
|
-
);
|
|
78
|
+
).authenticate(promptInfoBuilder.build());
|
|
72
79
|
|
|
73
80
|
} catch (Exception e) {
|
|
74
81
|
promise.reject(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/react-native-biometrics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|
|
@@ -43,6 +48,9 @@
|
|
|
43
48
|
"url": "https://github.com/ExodusMovement/react-native-biometrics/issues"
|
|
44
49
|
},
|
|
45
50
|
"homepage": "https://github.com/ExodusMovement/react-native-biometrics#readme",
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
46
54
|
"peerDependencies": {
|
|
47
55
|
"react": ">=16.8.0",
|
|
48
56
|
"react-native": ">=0.57.0"
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
isSupported: async () => {
|
|
7
7
|
return AndroidBiometrics.isSupported();
|
|
8
8
|
},
|
|
9
|
-
authenticate: async ({ title, subtitle, cancelButtonText }) => {
|
|
10
|
-
return AndroidBiometrics.authenticate(title, subtitle, cancelButtonText);
|
|
9
|
+
authenticate: async ({ title, subtitle, cancelButtonText, fallbackToPasscode = false }) => {
|
|
10
|
+
return AndroidBiometrics.authenticate(title, subtitle, cancelButtonText, fallbackToPasscode);
|
|
11
11
|
}
|
|
12
12
|
}
|