AuthPromptCallback


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 functions

Unit
onAuthenticationError(
    activity: FragmentActivity?,
    errorCode: Int,
    errString: CharSequence
)

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

Unit

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

Unit

Called when the user has successfully authenticated.

Public constructors

AuthPromptCallback

Added in 1.4.0-alpha02
AuthPromptCallback()

Public functions

onAuthenticationError

Added in 1.4.0-alpha02
fun onAuthenticationError(
    activity: FragmentActivity?,
    errorCode: Int,
    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?

The activity that is currently hosting the prompt.

errorCode: Int

An integer ID associated with the error.

errString: CharSequence

A human-readable string that describes the error.

onAuthenticationFailed

Added in 1.4.0-alpha02
fun onAuthenticationFailed(activity: FragmentActivity?): Unit

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

Parameters
activity: FragmentActivity?

The activity that is currently hosting the prompt.

onAuthenticationSucceeded

Added in 1.4.0-alpha02
fun onAuthenticationSucceeded(
    activity: FragmentActivity?,
    result: BiometricPrompt.AuthenticationResult
): Unit

Called when the user has successfully authenticated.

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

Parameters
activity: FragmentActivity?

The activity that is currently hosting the prompt.

result: BiometricPrompt.AuthenticationResult

An object containing authentication-related data.