setPINWithBiometry

fun setPINWithBiometry(fragment: Fragment, title: String, subtitle: String? = null, cancelText: String? = null, isDeviceCredentialsAllowed: Boolean = true, pin: String, completion: (Completion<Boolean>) -> Unit)

Sets or updates the user's PIN using biometric authentication.

Parameters

fragment

The fragment that will host the androidx.biometric.BiometricPrompt.

title
subtitle
cancelText

The negative button text of the androidx.biometric.BiometricPrompt.

isDeviceCredentialsAllowed

Sets whether the user should be given the option to authenticate with their device PIN, pattern, or password instead of biometry. Defaults to true. Note that if this option is set to truecancelText will not be set because it will replace the negative button on the BiometricPrompt.

pin

The PIN to be set.

completion

The block to be called when the request is completed including either the information if the PIN has been set / updated successfully or a Throwable.

fun setPINWithBiometry(activity: FragmentActivity, title: String, subtitle: String? = null, cancelText: String? = null, isDeviceCredentialsAllowed: Boolean = true, pin: String, completion: (Completion<Boolean>) -> Unit)

Sets or updates the user's PIN using biometric authentication.

Parameters

activity

The activity that will host the androidx.biometric.BiometricPrompt.

title
subtitle
cancelText

The negative button text of the androidx.biometric.BiometricPrompt.

isDeviceCredentialsAllowed

Sets whether the user should be given the option to authenticate with their device PIN, pattern, or password instead of biometry. Defaults to true. Note that if this option is set to truecancelText will not be set because it will replace the negative button on the BiometricPrompt.

pin

The PIN to be set.

completion

The block to be called when the request is completed including either the information if the PIN has been set / updated successfully or a Throwable.