I’m working on detecting which type of biometric authentication methods are supported on the device that the application is running on.
I’ve fully implemented, tested, and confirmed that the authentication method flow works perfectly. But now I want to include a button that will re-prompt the user for authentication if their initial fingerprint/face id scan fails. But I want to display a button with an appropriate image based on which auth type the user has, which has led me to the following feature: LocalAuthentication.supportedAuthenticationTypesAsync();
The only problem I have found is that this is returning an array.
You are implementing it correctly and it’s working as expected. If you did the following:
let types = await LocalAuthentication.supportedAuthenticationTypesAsync()
and the value of types was [2] that means only facial recognition is supported. [1,2] would indicate both fingerprint and facial support and [1] indicates just fingerprint support.
I’m going to add something to clarify this in our docs. Thanks for bringing this to light.
Yeah, it would be uncommon but we’ve implemented it this way so that if Apple decides to re-introduce fingerprint alongside facial recog. in new models or some Android device supports both in the future. I suppose that wouldn’t be a bad idea.