AuthPromptCallback


public abstract class AuthPromptCallback


A collection of methods that may be invoked by an auth prompt during authentication.

Each method receives a reference to the (possibly null) activity instance that is currently hosting the prompt. This reference should be used to fetch or update any necessary activity state in order for changes to be reflected across configuration changes.

Summary

Public constructors

Public methods

void
onAuthenticationError(
    @Nullable FragmentActivity activity,
    int errorCode,
    @NonNull CharSequence errString
)

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

void

Called when an authentication attempt by the user has been rejected.

void

Called when the user has successfully authenticated.

Public constructors

AuthPromptCallback

Added in 1.4.0-alpha02
public AuthPromptCallback()

Public methods

onAuthenticationError

Added in 1.4.0-alpha02
public void onAuthenticationError(
    @Nullable FragmentActivity activity,
    int errorCode,
    @NonNull 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
@Nullable FragmentActivity activity

The activity that is currently hosting the prompt.

int errorCode

An integer ID associated with the error.

@NonNull CharSequence errString

A human-readable string that describes the error.

onAuthenticationFailed

Added in 1.4.0-alpha02
public void onAuthenticationFailed(@Nullable FragmentActivity activity)

Called when an authentication attempt by the user has been rejected.

Parameters
@Nullable FragmentActivity activity

The activity that is currently hosting the prompt.

onAuthenticationSucceeded

Added in 1.4.0-alpha02
public void onAuthenticationSucceeded(
    @Nullable FragmentActivity activity,
    @NonNull BiometricPrompt.AuthenticationResult result
)

Called when the user has successfully authenticated.

After this method is called, no further events will be sent for the current authentication session.

Parameters
@Nullable FragmentActivity activity

The activity that is currently hosting the prompt.

@NonNull BiometricPrompt.AuthenticationResult result

An object containing authentication-related data.