Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable Pin/Pattern #5

Open
LonelyCpp opened this issue Jul 1, 2021 · 2 comments
Open

Option to disable Pin/Pattern #5

LonelyCpp opened this issue Jul 1, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@LonelyCpp
Copy link
Member

is there any possibility to hide the 'UsePin/UsePattern' form the prompt in android

Originally posted by @ndileep-dev in #3 (comment)

@LonelyCpp LonelyCpp added the enhancement New feature or request label Jul 1, 2021
@LonelyCpp LonelyCpp changed the title Disable Pin/UsePattern Option to disable Pin/Pattern Jul 1, 2021
@dcangulo
Copy link

dcangulo commented Sep 16, 2022

I use the following patch file to disable pin/pattern.

Filename: react-native-simple-biometrics+1.5.0.patch

diff --git a/node_modules/react-native-simple-biometrics/android/src/main/java/com/reactnativesimplebiometrics/SimpleBiometricsModule.java b/node_modules/react-native-simple-biometrics/android/src/main/java/com/reactnativesimplebiometrics/SimpleBiometricsModule.java
index d4c53a4..ab08598 100644
--- a/node_modules/react-native-simple-biometrics/android/src/main/java/com/reactnativesimplebiometrics/SimpleBiometricsModule.java
+++ b/node_modules/react-native-simple-biometrics/android/src/main/java/com/reactnativesimplebiometrics/SimpleBiometricsModule.java
@@ -23,8 +23,7 @@ public class SimpleBiometricsModule extends ReactContextBaseJavaModule {
     public static final String NAME = "SimpleBiometrics";
 
     static final int authenticators =  BiometricManager.Authenticators.BIOMETRIC_STRONG
-        | BiometricManager.Authenticators.BIOMETRIC_WEAK
-        | BiometricManager.Authenticators.DEVICE_CREDENTIAL;
+        | BiometricManager.Authenticators.BIOMETRIC_WEAK;
 
     public SimpleBiometricsModule(ReactApplicationContext reactContext) {
         super(reactContext);
@@ -82,6 +81,7 @@ public class SimpleBiometricsModule extends ReactContextBaseJavaModule {
                                         .setAllowedAuthenticators(authenticators)
                                         .setTitle(title)
                                         .setSubtitle(subtitle)
+                                        .setNegativeButtonText("Cancel")
                                         .build();
 
                                 prompt.authenticate(promptInfo);
diff --git a/node_modules/react-native-simple-biometrics/ios/SimpleBiometrics.mm b/node_modules/react-native-simple-biometrics/ios/SimpleBiometrics.mm
index 620c8ee..e91f895 100644
--- a/node_modules/react-native-simple-biometrics/ios/SimpleBiometrics.mm
+++ b/node_modules/react-native-simple-biometrics/ios/SimpleBiometrics.mm
@@ -33,10 +33,10 @@ @implementation SimpleBiometrics
 {
 
     dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-        NSString *promptMessage = subtitle;
+        NSString *promptMessage = title;
 
         LAContext *context = [[LAContext alloc] init];
-        context.localizedFallbackTitle = title;
+        context.localizedFallbackTitle = @"";
 
         LAPolicy localAuthPolicy = LAPolicyDeviceOwnerAuthenticationWithBiometrics;
         if (![[UIDevice currentDevice].systemVersion hasPrefix:@"8."]) {

@VariabileAleatoria
Copy link

I agree this feature should be added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants