Touch ID: Biometrics is locked. Code = -8

Im using the Touch id to identify iPhone users in my application, when used canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometricsto evaluate whether the user has the right to use the touch identifier, but after many unsuccessful attempts, even if the user has the right to use the touch identifier, he returns FALSE.

And this will make the application skip this step and think that the touch identifier is not supported on this device.

Here is the error I get:

Domain Error = com.apple.LocalAuthentication Code = -8 "Biometrics are blocked. UserInfo = {NSLocalizedDescription = Biometrics is blocked.}

+4
source share
1 answer

Ok, I think I found the answer. Hope this helps 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 unlocked by providing an access code on the iOS unlock screen, accessing the iOS TouchID settings and providing an access code, or manually launching an access code screen from the application. You can open the access code screen using the following snippet.

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

Of course, you can first check to see if you can evaluate this policy.

So, at the end, when the user successfully enters the password, the biometrics will be unlocked. Prior to iOS 10, this was done automatically by the operating system.

+8
source

Source: https://habr.com/ru/post/1658656/


All Articles