Touch ID: Biometry is locked out. Code=-8

ios, lacontext, objective-c, touch-id

Solution

Ok, I think that I found the answer. Hopefully it will help you. When you get

` Error Domain=com.apple.LocalAuthentication Code=-8 "Biometry is locked out." UserInfo={NSLocalizedDescription=Biometry is locked out.} `

iOS 10 blocks access to TouchID, it can be either unlocked by providing passcode on iOS unlock screen, accessing TouchID iOS settings and providing the passcode there or manually triggering the passcode screen from within the app. You can open the passcode screen using, following snippet.

let context = LAContext()
context.evaluatePolicy(LAPolicy.DeviceOwnerAuthentication,
                           localizedReason: reason,
                           reply: { (success, error) in
})

Of course you can first check if this policy can be evaluated.

So in the end, when the user successfully enters passcode, the biometry will be unlocked. Before iOS 10, this was done automatically by the operating system.

Problem

Im using Touch id to identify iPhone users in my app, when is use `canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics` to evaluate if the user is eligible for using Touch id, but after many failed tries even if the user is eligible for using touch id, it returns `FALSE`. And that will lead the app to skip this step and thinks that the touch id is not supported in this device. Here is the error i get: Error Domain=com.apple.LocalAuthentication Code=-8 "Biometry is locked out." UserInfo={NSLocalizedDescription=Biometry is locked out.}

Original source