시뮬레이터에서 최신 Xcode 9 GM (2019 년 9 월 13 일)을 실행했으며 Deployment Target 11.0
을 설정했습니다. 그러나 오류 코드 -이 나타납니다.iOS 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/TJBioAuthentication –