SelfLender / react-native-biometrics

React Native module for iOS and Android biometrics
MIT License
664 stars 228 forks source link

Biometrics not working on iOS 18 #294

Open radekzz opened 1 month ago

radekzz commented 1 month ago

Hi guys, library works fine on Android and iOS 17, but not on iOS 18.

 rnBiometrics.biometricKeysExist().then((resultObject) => {
    const { keysExist } = resultObject;

    if (keysExist) {
      console.log('Keys exist');
    } else {
      console.log('Keys do not exist or were deleted');
    }
  });

Always result in keysExist = false

const { success, error } = await rnBiometrics.simplePrompt({
      promptMessage: 'Confirm fingerprint',
      cancelButtonText: intl.formatMessage({ id: 'common.cancel' }),
    });

    if (success) {
      Logger.log('🎟', 'Successful biometrics provided');
    }
    if (error) {
      Logger.log('🎟', `Biometrics prompt error: ${error}`);
    }

Always result in Biometrics prompt failed with exception: Error Domain=com.apple.LocalAuthentication Code=-1000 "UI service connection invalidated." UserInfo={NSDebugDescription=UI service connection invalidated., NSLocalizedDescription=Authentication failed.} but i think this is only iOS 18 simulator bug. However on real device prompt always return false.

Do you have any idea? As i see library is not maintained anymore so i hope someone faced this problem and can give me some advice.

Hat52 commented 1 month ago

Facing the same issue, have you been able to fix this?

radekzz commented 1 month ago

Unfortunately not. However it seems not all real devices are facing this issue. I also tried other libraries with same result.

amitkumar144 commented 1 month ago

If you are using react-native-permission lib then used this version "react-native-permissions": "^3.8.4",

fellipe-ribeiro commented 2 weeks ago

If you are using react-native-permission lib then used this version "react-native-permissions": "^3.8.4",

@amitmehtacode Are you saying asking Face ID request permission before with "react-native-permissions" fix this issue?

fellipe-ribeiro commented 2 weeks ago

I did some research and it seems to be a bug only in the simulator on IOS 18 and not in the lib, it seems to work on real devices.

Case link: https://forums.developer.apple.com/forums/thread/761533