Android 12 Developer Preview is here! Try it out, and give us your feedback!

Class3BiometricAuthPrompt

open class Class3BiometricAuthPrompt
kotlin.Any
   ↳ androidx.biometric.auth.Class3BiometricAuthPrompt

An authentication prompt that requires the user to present a Class 3 biometric (e.g. fingerprint, face, or iris).

Summary

Nested classes

Builder for a Class3BiometricAuthPrompt with configurable options.

Public methods
open CharSequence?

Gets the description to be displayed on the prompt, if set.

open CharSequence

Gets the label text for the negative button on the prompt.

open CharSequence?

Gets the subtitle to be displayed on the prompt, if set.

open CharSequence

Gets the title to be displayed on the prompt.

open Boolean

Checks if the prompt should require explicit user confirmation after a passive biometric (e.g. iris or face) has been recognized but before

open AuthPrompt
startAuthentication(@NonNull host: AuthPromptHost, @Nullable crypto: BiometricPrompt.CryptoObject?, @NonNull callback: AuthPromptCallback)

Shows an authentication prompt to the user.

open AuthPrompt
startAuthentication(@NonNull host: AuthPromptHost, @Nullable crypto: BiometricPrompt.CryptoObject?, @NonNull executor: Executor, @NonNull callback: AuthPromptCallback)

Shows an authentication prompt to the user.

Extension functions
From androidx.biometric.auth
suspend BiometricPrompt.AuthenticationResult

Shows an authentication prompt to the user.

Public methods

getDescription

@Nullable open fun getDescription(): CharSequence?

Gets the description to be displayed on the prompt, if set.

Return
CharSequence? The description for the prompt.

getNegativeButtonText

@NonNull open fun getNegativeButtonText(): CharSequence

Gets the label text for the negative button on the prompt.

Return
CharSequence The negative button text for the prompt.

getSubtitle

@Nullable open fun getSubtitle(): CharSequence?

Gets the subtitle to be displayed on the prompt, if set.

Return
CharSequence? The subtitle for the prompt.

getTitle

@NonNull open fun getTitle(): CharSequence

Gets the title to be displayed on the prompt.

Return
CharSequence The title for the prompt.

isConfirmationRequired

open fun isConfirmationRequired(): Boolean

Checks if the prompt should require explicit user confirmation after a passive biometric (e.g. iris or face) has been recognized but before AuthPromptCallback#onAuthenticationSucceeded(androidx.fragment.app.FragmentActivity, * BiometricPrompt.AuthenticationResult) is called.

Return
Boolean Whether the prompt should require explicit user confirmation for passive biometrics.

startAuthentication

@NonNull open fun startAuthentication(
    @NonNull host: AuthPromptHost,
    @Nullable crypto: BiometricPrompt.CryptoObject?,
    @NonNull callback: AuthPromptCallback
): AuthPrompt

Shows an authentication prompt to the user.

Parameters
host AuthPromptHost: A wrapper for the component that will host the prompt.
crypto BiometricPrompt.CryptoObject?: A cryptographic object to be associated with this authentication.
callback AuthPromptCallback: The callback object that will receive and process authentication events. Each callback method will be run on the main thread.
Return
AuthPrompt A handle to the shown prompt.

startAuthentication

@NonNull open fun startAuthentication(
    @NonNull host: AuthPromptHost,
    @Nullable