0

I have an implementation of the Fingerprint Biometric authentication for Android which works pretty much as described by the documentation. I am trying to remove the close button aka the "setNegativeButtonText" value. This will make the biometric auth a requirement instead of an option.

Is it possible to do this?

NVA
  • 1,662
  • 5
  • 17
  • 24
  • "This will make the biometric auth a requirement instead of an option" -- it's always an option, insofar as the user can use system BACK navigation to close that dialog. – CommonsWare Dec 13 '22 at 21:02
  • Based on my implementation the back navigation will remove the entire activity as the Biometric Prompt is a pop up. – NVA Dec 13 '22 at 22:04

1 Answers1

1

BiometricPrompt does not allow that. So you won't be able to make the system-provided biometric prompt non-cancelable. But you can detect whenever user cancels the dialog.

Refer below

How to make BiometricPrompt non-cancelable?

You can use that cancel button as UsePassword instead with

setAllowedAuthenticators

See the release notes here

https://yggr.medium.com/simple-biometric-authentication-in-android-b01be3c40e6f

Hrusikesh
  • 185
  • 9
  • Thank you for this. My approach was to use the finish() method to close the Activity if the user clicks close on the onAuthenticationError callback method. – NVA Dec 15 '22 at 19:19