Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does LocalAuthentication support facial recognition? #11359

Closed
schmru opened this issue Dec 15, 2020 · 4 comments
Closed

Does LocalAuthentication support facial recognition? #11359

schmru opened this issue Dec 15, 2020 · 4 comments
Labels
needs validation Issue needs to be validated

Comments

@schmru
Copy link

schmru commented Dec 15, 2020

SDK Version: 38.0.8
Platforms(Android/iOS/web/all): Android 10
Hello, I am trying to implement facial recognition with LocalAuthentication for my app. My coworker has Samsung Galaxy A70 which he can unlock using facial recognition, but when it comes to my app it says he only has fingerprint supported. I added USE_BIOMETRIC to AndroidManifest but and am trying this on expo client.

Should I build an apk so that we can test this or should I add something else to the code, so that the application will recognise he also has facial recognition avaliable?

@schmru schmru added the needs validation Issue needs to be validated label Dec 15, 2020
@AdamJNavarro
Copy link
Contributor

Hey @schmru, if the device has facial recognition support than the LocalAuthentication module should recognize this. You can use the supportedAuthenticationTypesAsync method to check. https://docs.expo.io/versions/v40.0.0/sdk/local-authentication/#localauthenticationsupportedauthenticationtypesasync Also make sure that the device is enrolled (has fingerprint or facial data enabled).

I'm going to close this issue. For future reference, please direct questions like this one to our forums as we keep github issues reserved for reproducible and actionable bug reports. If you find that the device is enrolled and has facial recognition support but the module says otherwise, we can re-open this issue.

Cheers,
Adam

@mattiascaricato
Copy link

@AdamJNavarro in Android when you have both, touch id and face id configured, the authenticateAsync method it only asks for finger id. That being said, is there any way to define what is the biometric method I wanna use? The only way I could make face id work is removing my fingers configured in my phone, so when I call authenticateAsync it uses face id. I don't think this is the expected behavior, any idea?

@WolfyUK
Copy link

WolfyUK commented Apr 13, 2021

@mattiascaricato Agreed. I'm not sure this issue should be closed. On Android, the results returned from supportedAuthenticationTypesAsync() are not always the same as the user has actually configured. This may be replicated with Samsung Galaxy S8 devices too but I'm unable to confirm if it's a Samsung-only issue as Huawei devices were also being weird.

The only time I've ever seen FACIAL_RECOGNITION come back from the call above on Android is on a Google Pixel 4 device that does not have a fingerprint scanner. I think that there may be some additional configuration or permissions required somewhere in order to resolve this but I guess that's up to the Expo guys to comment on. For the moment we're going to have to change phrasing across our app to assume that supportedAuthenticationTypesAsync() is inaccurate on Android and instead use something more generic.

I modified some existing Snacks to verify this on both Expo 39 and 40:

@WolfyUK
Copy link

WolfyUK commented Apr 13, 2021

There seems to be a similar discussion on #7838 with a potential fix mentioned in version 9.2.0 of expo-local-authentication, but the Snacks above use 9.3.0 to no avail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs validation Issue needs to be validated
Projects
None yet
Development

No branches or pull requests

4 participants