hieuvp / react-native-fingerprint-scanner

Provide Fingerprint, Touch ID, and Face ID Scanner for React Native (Compatible with both Android and iOS)
https://www.npmjs.com/package/react-native-fingerprint-scanner
871 stars 297 forks source link

Sometimes the modal doesn't show on iOS and Android #139

Closed SMJ93 closed 4 years ago

SMJ93 commented 4 years ago

Hi, first of all great library. Managed to get it working in no time!

Is there a reason the modal doesn't always show? It triggers the onSuccess callback but I never see the modal. This happens on both iOS and Android.

I am using: version 5.0.0 with react-native 0.62.2

I am using functional components:

useEffect(() => {
if (isIOS) {
    FingerprintScanner.authenticate({
      description: 'Scan your fingerprint on the device scanner to continue',
    })
      .then(() => onSuccess())
      .catch((error) => {
        biometricsErrorHandler(error);
        onError();
      });
  } else {
    FingerprintScanner.authenticate({title: 'Log in with Biometrics'})
      .then(() => onSuccess())
      .catch((error) => {
        biometricsErrorHandler(error);
        onError();
      });
  }
}, [],
Dwayne01 commented 4 years ago

what was the solution to this issue

SMJ93 commented 4 years ago

Hi @Dwayne01,

I think it was conflicting with another library if I remember correctly.