portfolio-performance / mobile-app

4 stars 0 forks source link

In Android, add .setConfirmationRequired(false) to the biometric prompt so that face unlock does NOT require tapping a "Confirm" button after successul authentication. #39

Open victor-marino opened 2 months ago

victor-marino commented 2 months ago

Portfolio Performance is using the Biometrics API in Android to allow the user to protect their portfolio with whatever biometric options are available in their phone.

For most people, this is going to be a fingerprint reader. However, some phones (like newer Pixels), also support secure face scanning. If the user has enabled the option, by default the biometric prompt will first try to scan their face, as that's the quickest option.

However, by default, after a successful face authentication the Biometrics API will not progress to the next screen. Instead, it will prompt the user to press a "Confirm" button before moving forward, as seen is this example: image

This is the way Portfolio Performance currently behaves.

This makes sense for more sensitive operations (e.g.: confirming a purchase), but isn't really needed when just logging into an app.

From the Android docs:

Authenticate without explicit user action

By default, the system requires users to perform a specific action, such as pressing a button, after their biometric credentials are accepted. This configuration is preferable if your app is showing the dialog to confirm a sensitive or high-risk action, such as making a purchase.

If your app shows a biometric authentication dialog for a lower-risk action, however, you can provide a hint to the system that the user doesn't need to confirm authentication. This hint can allow the user to view content in your app more quickly after re-authenticating using a passive modality, such as face- or iris-based recognition. To provide this hint, pass false into the setConfirmationRequired() method.

Banking apps like Revolut, for instance, already do this, so the login experience is completely seamless. You tap on the icon, the system immediately recognises your face and you're taken straight to the app's main menu (same as on iPhone).

Could you please add .setConfirmationRequired(false) to the Biometric prompt in Android so we also get a smooth login experience when using face unlock?