react-native-touch-id
react-native-touch-id copied to clipboard
[Android] Custom fingerprint prompt
How difficult would it be to modify the android TouchID.authenticate
configuration options to accept a custom prompt? This would enable customisation to make the prompt more in line with the rest of the app design.
This could be also done less imperatively by implementing a TouchId
component with a render prop:
<TouchId>
{
({ authenticate }) => (
// my custom prompt component will use authenticate here
)
}
</TouchId>
This can be also refactored to a useTouchId
hook once react-native supports them.
What do you think?
I think it's against Google's guidelines, and if you at like #165 - I want to move away from this implementation to a more standard UI supported by Google.
@zibs Actually, my goal is exactly to have something that resembles more closely the new BiometricPrompt implemented by Android P.
Unfortunately, there are a few problems with the new Biometrics API:
- The compat library for older Android versions is still an alpha;
- With the BiometricPrompt there is no way to detect the presence of hardware or if a user is enrolled in biometrics without trying to launch the prompt. This loss of functionality would break the
isSupported
function in this library. For more info, you can look at this issue on Google Issue Tracker.
So, we could either support a custom prompt (but I agree that it would provide a less consistent UX) or replace the current prompt with something that resembles the new BiometricsPrompt (this article suggests an implementation). I would defer the implementation of the new API to a future in which they are more stable.
guys, any update over this? like if we can customize the prompt or display a modal instead of default one?