File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
src/main/java/com/smallcase/rnbiometrics Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ buildscript {
2121 jcenter()
2222 }
2323 dependencies {
24- classpath ' com.android.tools.build:gradle:3.4.1 '
24+ classpath ' com.android.tools.build:gradle:3.4.3 '
2525 }
2626 }
2727}
@@ -61,7 +61,7 @@ repositories {
6161dependencies {
6262 // noinspection GradleDynamicVersion
6363 implementation ' com.facebook.react:react-native:+' // From node_modules
64- implementation ' androidx.biometric:biometric:1.0.1 '
64+ implementation ' androidx.biometric:biometric:1.1.0 '
6565}
6666
6767def configureReactNativePom (def pom ) {
Original file line number Diff line number Diff line change 1717import java .util .concurrent .Executor ;
1818
1919public class RNBiometricsModule extends ReactContextBaseJavaModule {
20-
20+ static final int authenticators = BiometricManager .Authenticators .BIOMETRIC_STRONG
21+ | BiometricManager .Authenticators .BIOMETRIC_WEAK
22+ | BiometricManager .Authenticators .DEVICE_CREDENTIAL ;
2123
2224 public RNBiometricsModule (ReactApplicationContext reactContext ) {
2325 super (reactContext );
@@ -33,7 +35,10 @@ public void canAuthenticate(Promise promise) {
3335 try {
3436 ReactApplicationContext context = getReactApplicationContext ();
3537 BiometricManager biometricManager = BiometricManager .from (context );
36- boolean can = biometricManager .canAuthenticate () == BiometricManager .BIOMETRIC_SUCCESS ;
38+
39+ int res = biometricManager .canAuthenticate (authenticators );
40+ boolean can = res == BiometricManager .BIOMETRIC_SUCCESS ;
41+
3742 promise .resolve (can );
3843 } catch (Exception e ) {
3944 promise .reject (e );
@@ -68,9 +73,9 @@ public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationRes
6873 BiometricPrompt prompt = new BiometricPrompt ((FragmentActivity ) activity , mainExecutor , authenticationCallback );
6974
7075 BiometricPrompt .PromptInfo promptInfo = new BiometricPrompt .PromptInfo .Builder ()
76+ .setAllowedAuthenticators (authenticators )
7177 .setTitle (title )
7278 .setSubtitle (subtitle )
73- .setDeviceCredentialAllowed (true )
7479 .build ();
7580
7681 prompt .authenticate (promptInfo );
Original file line number Diff line number Diff line change @@ -25,4 +25,4 @@ android.useAndroidX=true
2525android.enableJetifier =true
2626
2727# Version of flipper SDK to use with React Native
28- FLIPPER_VERSION =0.37 .0
28+ FLIPPER_VERSION =0.74 .0
You can’t perform that action at this time.
0 commit comments