Language

BiometricPrompt.Builder.SetDeviceCredentialAllowed(Boolean) Method

Definition

Optional: If enabled, the user will be given the option to authenticate with their device PIN, pattern, or password.

[Android.Runtime.Register("setDeviceCredentialAllowed", "(Z)Landroid/hardware/biometrics/BiometricPrompt$Builder;", "GetSetDeviceCredentialAllowed_ZHandler", ApiSince=29)]
public virtual Android.Hardware.Biometrics.BiometricPrompt.Builder SetDeviceCredentialAllowed(bool allowed);
[<Android.Runtime.Register("setDeviceCredentialAllowed", "(Z)Landroid/hardware/biometrics/BiometricPrompt$Builder;", "GetSetDeviceCredentialAllowed_ZHandler", ApiSince=29)>]
abstract member SetDeviceCredentialAllowed : bool -> Android.Hardware.Biometrics.BiometricPrompt.Builder
override this.SetDeviceCredentialAllowed : bool -> Android.Hardware.Biometrics.BiometricPrompt.Builder

Parameters

allowed
Boolean

true if the prompt should fall back to asking for the user's device credential (PIN/pattern/password), or false otherwise.

Returns

This builder. This value cannot be null.

Attributes

Remarks

This method was deprecated in API level 30. Replaced by setAllowedAuthenticators(int).

Optional: If enabled, the user will be given the option to authenticate with their device PIN, pattern, or password. Developers should first check BiometricManager.canAuthenticate(int) for Authenticators.DEVICE_CREDENTIAL before enabling. If the device is not secured with a credential, AuthenticationCallback.onAuthenticationError(int,CharSequence) will be invoked with BiometricPrompt.BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL. Defaults to false.

Note that enabling this option replaces the negative button on the prompt with one that allows the user to authenticate with their device credential, making it an error to call setNegativeButton(CharSequence,Executor,DialogInterface.OnClickListener).

Android reference for android.hardware.biometrics.BiometricPrompt.Builder.setDeviceCredentialAllowed.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to