AuthPromptCallback
abstract class AuthPromptCallback
kotlin.Any | |
↳ | androidx.biometric.auth.AuthPromptCallback |
A collection of methods that may be invoked by Class2BiometricAuthPrompt
, Class3BiometricAuthPrompt
, Class2BiometricOrCredentialAuthPrompt
, Class3BiometricOrCredentialAuthPrompt
, or CredentialAuthPrompt
during authentication, returning the androidx.fragment.app.FragmentActivity
the prompt is attached to.
Summary
Public constructors | |
---|---|
<init>() A collection of methods that may be invoked by |
Public methods | |
---|---|
open Unit |
onAuthenticationError(@Nullable activity: FragmentActivity?, errorCode: Int, @NonNull errString: CharSequence) Called when an unrecoverable error has been encountered and authentication has stopped. |
open Unit |
onAuthenticationFailed(@Nullable activity: FragmentActivity?) Called when a biometric (e.g. fingerprint, face, etc.) is presented but not recognized as belonging to the user. |
open Unit |
onAuthenticationSucceeded(@Nullable activity: FragmentActivity?, @NonNull result: BiometricPrompt.AuthenticationResult) Called when a biometric (e.g. fingerprint, face, etc.) is recognized, indicating that the user has successfully authenticated. |
Public constructors
<init>
AuthPromptCallback()
A collection of methods that may be invoked by Class2BiometricAuthPrompt
, Class3BiometricAuthPrompt
, Class2BiometricOrCredentialAuthPrompt
, Class3BiometricOrCredentialAuthPrompt
, or CredentialAuthPrompt
during authentication, returning the androidx.fragment.app.FragmentActivity
the prompt is attached to.
Public methods
onAuthenticationError
open fun onAuthenticationError(
@Nullable activity: FragmentActivity?,
errorCode: Int,
@NonNull errString: CharSequence
): Unit
Called when an unrecoverable error has been encountered and authentication has stopped.
After this method is called, no further events will be sent for the current authentication session.
Parameters | |
---|---|
activity |
FragmentActivity?: androidx.fragment.app.FragmentActivity the prompt is attached to |
errorCode |
Int: An integer ID associated with the error. |
errString |
CharSequence: A human-readable string that describes the error. |
onAuthenticationFailed
open fun onAuthenticationFailed(@Nullable activity: FragmentActivity?): Unit
Called when a biometric (e.g. fingerprint, face, etc.) is presented but not recognized as belonging to the user.
Parameters | |
---|---|
activity |
FragmentActivity?: androidx.fragment.app.FragmentActivity the prompt is attached to |
onAuthenticationSucceeded
open fun onAuthenticationSucceeded(
@Nullable activity: FragmentActivity?,
@NonNull result: BiometricPrompt.AuthenticationResult
): Unit
Called when a biometric (e.g. fingerprint, face, etc.) is recognized, indicating that the user has successfully authenticated.
After this method is called, no further events will be sent for the current authentication session.
Parameters | |
---|---|
activity |
FragmentActivity?: androidx.fragment.app.FragmentActivity the prompt is attached to |
result |
BiometricPrompt.AuthenticationResult: An object containing authentication-related data. |