मैंने नवीनतम एक्सकोड 9 जीएम (13 सितंबर 2017) चलाया है और Hardware > Face ID > Enrolled
सिम्युलेटर के साथ-साथ Deployment Target 11.0
सेट किया है। हालांकि मुझे त्रुटि कोड मिल रहा है -6 LAErrorTouchIDNotAvailable
।आईओएस 11 सिम्युलेटर LAContext और FaceID को अनुमति नहीं दे रहा है
क्या कोई सेटिंग है जो मुझे याद आ रही है?
let myContext = LAContext()
let myLocalizedReasonString = "You are pretty"
var authError: NSError?
if #available(iOS 8.0, macOS 10.12.1, *) {
if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
myContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: myLocalizedReasonString) { success, evaluateError in
if success {
print("// User authenticated successfully, take appropriate action")
} else {
print(" // User did not authenticate successfully, look at error and take appropriate action")
}
}
} else {
print(" // Could not evaluate policy; look at authError and present an appropriate message to user")
}
} else {
print(" // Fallback on earlier versions")
}
उपयोग इस पुस्तकालय, यह faceid का समर्थन करता है और दोनों TouchID । https://github.com/tejas-ardeshna/TJBio प्रमाणीकरण –