react-native-simple-biometrics
react-native-simple-biometrics copied to clipboard
Option to disable Pin/Pattern
is there any possibility to hide the 'UsePin/UsePattern' form the prompt in android
Originally posted by @ndileep-dev in https://github.com/smallcase/react-native-simple-biometrics/issues/3#issuecomment-871886727
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."]) {
I agree this feature should be added