Qt 6.11 is out! See what's new in the release
blog
Android Biometrics - Receive result while app is suspended (during credential input)
-
Hello everyone,
I am currently implementing biometric authentication in an Android app. The method checking current Biometric status on the device and creating a prompt is a static method in the main app activity.
The process is as follows:
- App calls static method which creates and displays the Android Biometric prompt
- User uses fingerprint/face/iris detection
- App receives a result
This part works... but:
If the user decides to use their credentials (PIN/pattern) to authenticate, it suspends the app to display the PIN entry view from Android. This causes the app to not receive the result of the authentication, probably because the native call I'm using cannot be performed due to the app being suspended until after authentication finishes in this case.So I am wondering:
- Is there a reliable way to store the result of the authentication temporarily so it can be fetched from within the app when it resumes?
- Or do I need to set up additional callbacks for credential authentication? Right now, I am overriding onAuthenticationError(), onAuthenticationSucceeded() and onAuthenticationFailed() of the Biometric prompt.
I would greatly appreciate some help. Thank you.