Tôi có cài đặt LocalAuthentication sau đây như được mô tả ở nhiều nơi.TouchID activateTouchWithResponse trả về thành công mà không yêu cầu dấu vân tay
context.evaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, localizedReason: "Logging in with Touch ID", reply: { (success : Bool, error : NSError?) -> Void in
dispatch_async(dispatch_get_main_queue(), {
if success {
let alert = UIAlertController(title: "Success", message: "", cancelButtonTitle: "Great!")
self.presentViewController(alert, animated: true, completion: nil)
}
if let error = error {
var message :String
switch(error.code) {
case LAError..AuthenticationFailed:
message = "There was a problem verifying your identity."
case LAError..UserCancel:
message = "You pressed cancel."
case LAError..UserFallback:
message = "You pressed password."
default:
message = "Touch ID may not be configured"
}
let alert = UIAlertController(title: "Error", message: message, cancelButtonTitle: "Darn!")
self.presentViewController(alert, animated: true, completion: nil)
}
})
})
Nhưng sau khi tôi đã xác thực thành công bằng vân tay của mình, sau đó đánh giáPolicy (, localizedReason :, reply :) trả về thành công mà không yêu cầu bất kỳ vân tay nào. Tôi thực sự đang bật hoặc tắt TouchID bằng UISwitch, vì vậy sau khi tắt và bật lại, tôi muốn xác thực lại và nhập lại vân tay của mình.
Tại sao bộ đệm ẩn trong xác thực?
Cảm ơn
thêm lỗi làm người khác nếu và xem điều gì xảy ra. – Konsy
Lỗi là không. Lần thứ hai tôi đánh giá chính sách tôi nhận được thành công và lỗi mà không được nhắc chạm vào nút. –
Hãy thử làm nếu lỗi! = Nil thay vì – Konsy