When Biometric prompt is shown in App with setDeviceCredentialAllowed(true), It is not dismissed when device home button is pressed. It throws BiometricPrompt.ERROR_USER_CANCELED error and keeps the System UI as is.
Did any one face this issue ? Is there any workaround kind of thing ?
Note : I am using androidx.biometric:biometric:1.0.1
Note: Its Android bug. https://issuetracker.google.com/issues/149770989
public class BiometricPrompt. A class that manages a system-provided biometric prompt. On devices running Android 9.0 (API 28) and above, this will show a system-provided authentication prompt, using one of the device's supported biometric modalities (fingerprint, iris, face, etc).
To check whether biometric authentication is supported on a device, use BiometricsManager. canAuthenticate() . This call returns a success flag when the device has available biometric hardware, and the user has a biometric enrolled on the device.
setCancelable(false) .
I found this bug when I tried this library. The problem is they implemented it as a fragment, and it's not responding well to this thing.
I opted out of using this library all together and just implemented it myself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With