getSupportedBiometryType returns null if user denied access
currently if the user denies access to Face ID, getSupportedBiometryType returns null
it would be useful to know that the user has denied access, to be able to redirect the user to app settings to fix the situation (in case the user made a mistake or changed their mind)
i understand this wouldn't be backwards compatible, so maybe we can add a second method that returns a more verbose response than getSupportedBiometryType?
Came here to mention the same issue. There isn't a reliable way to determine whether the device supports FaceID if it's been disabled at the OS app settings level. This could be an intentional security feature on iOS.
@mvayngrib I submitted a PR that I believe should fix this issue (it did for me). Try it out: https://github.com/oblador/react-native-keychain/pull/240
I am using a custom flag to store this info to async storage which is based on the response of the initial prompt for biometric access as a workaround.
I am using a custom flag to store this info to async storage which is based on the response of the initial prompt for biometric access as a workaround.
This sounds like it would solve my use case @dsouzaedison - what is the error response you can expect to get back from the initial prompt that indicates the user declined?
@allisonkbarr This issue should be fixed (see https://github.com/oblador/react-native-keychain/pull/240) meaning getSupportedBiometryType should now return the device's biometry type regardless of the permission state.
@allisonkbarr This issue should be fixed (see #240) meaning
getSupportedBiometryTypeshould now return the device's biometry type regardless of the permission state.
Yes I'm actually looking for the opposite - I want to know that the user declined the permission so that I do not make it appear to the user that they can still enable biometric login from the app (once they have declined permission, additional requests will fail).
@allisonkbarr You may need a separate lib to get that information: react-native-permissions can provide this info via the check method.
@petekp Do you know how to check whether the user has enrolled at least one finger for Touch ID? The library you mention doesn't provide that info, as it's technically not a permission (unlike Face ID), and with #240 merged we can no longer easily find out if our app can assume Touch ID to be available in practice…
@richeterre Have you tried using canImplyAuthentication? We use this with Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET to determine if the enrolled fingers have changed. If I remember correctly this should also return false if no fingers have been enrolled.
@petekp Works like a charm, thanks for the tip! 💯
@petekp @oblador stil this issue exists, getSupportedBiometryType returns null if user denied access When i denied the face id permission, getSupportedBiometryType return null tried ios 17.2 +
any help would appreciated.
Hi @oblador @vonovak, Facing same issue in iOS 17.5+ is there any workaround? Anyways thanks a lot for creating this library :)