My app can use biometric authentication, and the ios app only tries the face id biometric for 2 times, the problem is, I need to make it try for 3 times before adding an option of entering it's password, how can I do that?
This is my code for accessing the biometric authentication
func loginWithBiometrics() {
let context = LAContext()
var error: NSError?
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
let reason = "Identify yourself!"
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { [weak self] success, authenticationError in
DispatchQueue.main.async {
if success {
print("success")
} else {
print("Failed biometric!")
}
}
}
} else {
print("Biometric not available!")
}
}
It only tries the face id for 2 times and then suggest it to enter your password after 2 face id mistakes.
My expectation is to make the user try the face id for 3 times instead of 2.