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

Not Detecting TouchID not enrolled #233

Open skyshine999 opened 5 years ago

skyshine999 commented 5 years ago

Using this plugin i can check supporting and authentication but whether user enrolled touchid or not . How can we check it

bryantee commented 4 years ago

I second this. Would love if we could expose whether device is enrolled before I prompt user for authentication.

JeffreyLeeDave commented 4 years ago

I honestly thought that isSupported was suppose to do that. I think there is a bug in this package. it's suppose to return a LAErrorTouchIDNotEnrolled error when this happens. I know for android it returns false when it's not enrolled.

JeffreyLeeDave commented 4 years ago

Hey if you are still encountering this issue, look here: https://github.com/naoufal/react-native-touch-id/issues/171

Basically you just need to pass in {passcodeFallback: false}. Technically it is in the documentation. It's the comment in the example provided here: https://github.com/naoufal/react-native-touch-id#issupported

I don't know why that field is coupled with this error logic, but this is probably what caused a lot of people confusion

JeffreyLeeDave commented 4 years ago

I will say though, one thing I hate about doing that is that I get a typescript error. This package is really weird the type for IsSupportedConfig does not have have passcodeFallback as a property.