I have an app need the fingerprint authentication when every time the app started, so that i have put the fingerprint authentication into applicationDidBecomeActive in AppDelegate.
After my iPad and Xcode updated to iOS 13, the fingerprint dialog popup delayed around 30 seconds to 1 min. (It is popup immediately before updated to iOS 13)
Has anyone had a similar situation?
if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error){
let reason = "Fingerprint Login"
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason ) { success, error in
if success {
DispatchQueue.main.async { [unowned self] in
print("Success")
}
} else {
print(error?.localizedDescription ?? "Failed to authenticate")
}
}
I read that this is a common bug in iOS 13, i think they will fix it in the upcoming versions, for now just call context.evaluatePolicy
twice like that :
if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error){
let reason = "Fingerprint Login"
if #available(iOS 13.0, *) {
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason ) { (_,_) in }
}
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason ) { success, error in
if success {
DispatchQueue.main.async { [unowned self] in
print("Success")
}
} else {
print(error?.localizedDescription ?? "Failed to authenticate")
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With