react-native-touch-id icon indicating copy to clipboard operation
react-native-touch-id copied to clipboard

[Android] Custom fingerprint prompt

Open simonedavico opened this issue 5 years ago • 3 comments

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?

simonedavico avatar Nov 07 '18 16:11 simonedavico

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 avatar Nov 07 '18 16:11 zibs

@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:

  1. The compat library for older Android versions is still an alpha;
  2. 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 theisSupported 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.

simonedavico avatar Nov 07 '18 17:11 simonedavico

guys, any update over this? like if we can customize the prompt or display a modal instead of default one?

devanshsadhotra25 avatar Sep 09 '19 11:09 devanshsadhotra25