Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

AuthenticationCallback

abstract class AuthenticationCallback
kotlin.Any
   ↳ androidx.biometric.BiometricPrompt.AuthenticationCallback

Callback structure provided to BiometricPrompt. Users of must provide an implementation of this for listening to fingerprint events.

Summary

Public constructors

Callback structure provided to BiometricPrompt.

Public methods

open Unit
onAuthenticationError(errorCode: Int, @NonNull errString: CharSequence)

Called when an unrecoverable error has been encountered and the operation is complete.

open Unit

Called when a biometric is valid but not recognized.

open Unit

Called when a biometric is recognized.

Public constructors

<init>

AuthenticationCallback()

Callback structure provided to BiometricPrompt. Users of must provide an implementation of this for listening to fingerprint events.

Public methods

onAuthenticationError

open fun onAuthenticationError(errorCode: Int, @NonNull errString: CharSequence): Unit

Called when an unrecoverable error has been encountered and the operation is complete. No further actions will be made on this object.

Parameters
errorCode Int: An integer identifying the error message. The error message will usually be one of the BIOMETRIC_ERROR constants.
errString Int: A human-readable error string that can be shown on an UI

onAuthenticationFailed

open fun onAuthenticationFailed(): Unit

Called when a biometric is valid but not recognized.

onAuthenticationSucceeded

open fun onAuthenticationSucceeded(@NonNull result: BiometricPrompt.AuthenticationResult): Unit

Called when a biometric is recognized.

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