naoufal / react-native-touch-id

React Native authentication with the native Touch ID popup.
https://www.npmjs.com/package/react-native-touch-id
1.47k stars 477 forks source link

[iOS] iPhone 5C is detected as "isSupported" but it doesn't have a TouchID #220

Open ljnjulien opened 5 years ago

ljnjulien commented 5 years ago

In our project, we're using the method "isSupported" to detect if the device (iOS or Android) supports the biometric functionality.

When we test on an iPhone 5C, isSupported returns "TouchID" although this device doesn't support the feature.

Is it an issue you're aware of ? Is there a workaround ?

BenWildeman commented 5 years ago

The issue goes deeper than this. for Apple devices that do have touchID/faceID, it'll return as supported even though the user hasn't enrolled their fingerprint/enabled faceID or touchID so there's definitely a bug

BenWildeman commented 5 years ago

@naoufal I've found that this bug was introduced in 4.2.0. 4.1.0 was the last version where this worked as intended

r-bman commented 5 years ago

It's not ideal but I just did this to solve the issue:


if (biometryType === 'None') {
    throw {
        name: 'RCTTouchIDNotSupported',
        message: 'Device does not support Touch ID.',
    };
}
alhaiz313 commented 4 years ago

iphone 4s is returning "TouchID" from isSupported function even though it doesn't support TouchID