-
-
Save vinodbaste/48f5bfa7d7dd2eed253d8b378065dab9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun setBiometricPromptInfo( | |
title: String, | |
subtitle: String, | |
description: String, | |
allowDeviceCredential: Boolean | |
): BiometricPrompt.PromptInfo { | |
val builder = BiometricPrompt.PromptInfo.Builder() | |
.setTitle(title) | |
.setSubtitle(subtitle) | |
.setDescription(description) | |
// Use Device Credentials if allowed, otherwise show Cancel Button | |
builder.apply { | |
if (allowDeviceCredential) setDeviceCredentialAllowed(true) | |
else setNegativeButtonText("Cancel") | |
} | |
return builder.build() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment