English topic guide inspired by the original iOS Developer Notebook, expanded for both iOS and Android teams.
let context = LAContext()
var error: NSError?
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
localizedReason: "Unlock vault") { ok, _ in }
}
val prompt = BiometricPrompt(this, executor, callback)
val info = BiometricPrompt.PromptInfo.Builder()
.setTitle("Unlock vault")
.setAllowedAuthenticators(BIOMETRIC_STRONG or DEVICE_CREDENTIAL)
.build()
prompt.authenticate(info)