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
[local-authentication] add new biometric type for android biometric prompt #8364
Conversation
@@ -58,10 +64,10 @@ Attempts to authenticate via Fingerprint/TouchID (or FaceID if available on the | |||
#### Arguments | |||
|
|||
- **options (_object_)** -- An object of options. | |||
- **promptMessage (_string_)** -- A message that is shown alongside the TouchID or FaceID prompt. (**iOS only**) | |||
- **cancelLabel (_string_)** -- Allows to customize the default `Cancel` label shown. (**iOS only**) | |||
- **promptMessage (_string_)** -- A message that is shown alongside the TouchID, FaceID or Biometric prompt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the iOS only tags here because this is also implemented in Android now (via #8219)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥇
Thanks for updating docs ;) I've forgotten about it :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me,
but...
changelog entry please! 😁e5217c3
to
505fbd1
Compare
Done! Even used |
@byCedric - take a look at this new comment: #7838 (comment) |
@tsapeta it does seems to detect if a biometric method is available. But this still doesn't help the user, imho. You still can't ask the BiometricPrompt to use a specific authentication method, right? |
Yeah, we can't specify authentication type, but that would give us more info which types are supported. Also, looks like some new features will be added in Android 11. https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt#getAllowedAuthenticators() and https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.Builder#setAllowedAuthenticators(int) |
Awesome, but still, this doesn't allow us to specify either fingerprint, facial recognition or iris authentication. It only allows us to define the strength of the authentication. But both fingerprint and face recognition can be strong and weak 🙈 It does provide a way for using the device credentials, but I think that's mostly covered with So instead of matching the functionality with iOS, implementing this will only deviate more from the iOS behavior I guess. From the Authenticator docs:
|
I'm not sure adding If the device supports a single type, then in theory that should match what it presented to the user. If the device supports multiple types more generic UI may need to be used as it would not be clear which method the system would select. Unfortunately this is the path Google is taking at the moment though. When Android R comes along having the option to set |
Yeah, generally right now
I agree here – if the device supports only one type, then users can build specific UI for this.
Actually we can say that |
So that would mean we could do an "estimate" of what type of authentication would be used? But is that good enough to implement? |
We can predict what type of authentication would be used, but certainly we shouldn't do this in our API 🙃 |
Having |
I'm happy to work on a pull request for these changes if needed. |
Let's go for the backwards-compatible implementation! |
…ith package manager (#8431) # Why See #8364 # How See #8364 # Test Plan See #7838 or https://snack.expo.io/@ouihealth/a78fc1
Why
Fixes #7838
How
I added the type both in Android and iOS. On Android, it's the only type that we return if Biometric Prompt can be used. For iOS, the biometric type is included if either facial recognition or touch id is available.
Test Plan
See #7838 or https://snack.expo.io/@ouihealth/a78fc1