Google is committed to advancing racial equity for Black communities. See how.

AuthPromptCallback

public abstract class AuthPromptCallback
extends Object

java.lang.Object
   ↳ androidx.biometric.auth.AuthPromptCallback


A collection of methods that may be invoked by Class2BiometricAuthPrompt, Class3BiometricAuthPrompt, Class2BiometricOrCredentialAuthPrompt, Class3BiometricOrCredentialAuthPrompt, or CredentialAuthPrompt during authentication, returning the FragmentActivity the prompt is attached to.

Summary

Public constructors

AuthPromptCallback()

Public methods

void onAuthenticationError(FragmentActivity activity, int errorCode, CharSequence errString)

Called when an unrecoverable error has been encountered and authentication has stopped.

void onAuthenticationFailed(FragmentActivity activity)

Called when a biometric (e.g.

void onAuthenticationSucceeded(FragmentActivity activity, BiometricPrompt.AuthenticationResult result)

Called when a biometric (e.g.

Inherited methods

Public constructors

AuthPromptCallback

public AuthPromptCallback ()

Public methods

onAuthenticationError

public void onAuthenticationError (FragmentActivity activity, 
                int errorCode, 
                CharSequence errString)

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: 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

public void onAuthenticationFailed (FragmentActivity activity)

Called when a biometric (e.g. fingerprint, face, etc.) is presented but not recognized as belonging to the user.

Parameters
activity FragmentActivity: FragmentActivity the prompt is attached to

onAuthenticationSucceeded

public void onAuthenticationSucceeded (FragmentActivity activity, 
                BiometricPrompt.AuthenticationResult result)

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: FragmentActivity the prompt is attached to

result BiometricPrompt.AuthenticationResult: An object containing authentication-related data.