How much time is locked Touch ID? "Biometry is locked out."
Asked Answered
C

3

9

I'm trying to implement Touch ID login, but when user fails more than maximum attempts, I receive this error "Error Domain=com.apple.LocalAuthentication Code=-8 "Biometry is locked out." UserInfo={NSLocalizedDescription=Biometry is locked out.}"

I want to know:

  • How much time, and where can i check it is locked touch id?
  • Is possible to force unlock without show the passcode?
  • If user fails all attempts with passcode, how much time is locked touch id, or how can I force unlock it?

Thanks!

Chaparajos answered 30/1, 2017 at 10:59 Comment(0)
C
7

Touch ID, once locked-out due to incorrect tries, will be locked until the user enters the passcode. So there is no set time. The only way to unlock will be the passcode from this point onwards and there is no way to force an unlock, for obvious reasons.

Cyndicyndia answered 30/1, 2017 at 11:40 Comment(7)
But is it impossible to know how long to wait for unlock after lock it? I mean when you fail X times with biometrics and then fail X times with passcode, iPhone locks both methods, but I cant see how many time i have to wait for unlock it.Rositaroskes
You are not informed about the amount of time the phone is locked for. There is absolutely no way to know that information. Secondly, if you are trying to determine this in your app, you're probably going about the problem the incorrect way.Cyndicyndia
there is no way to handle this ??Isochronize
@shaqirsaiyed - There are ways to handle this. There is however, no way to override the security feature.Cyndicyndia
@RobertJ.Clegg by handle you mean we can show some alert to user right ? Like if user is locked out after few attempts then...Isochronize
@shaqirsaiyed Yeah, you could do that. However I think it would be pointless as the user would know that they're locked out - the OS displays an alert after no many wrong tried.Cyndicyndia
@RobertJ.Clegg ok. Though I checked when user go to settings and enter passcode once then it unlocks Touch ID.Isochronize
D
8

You can unlock the biometry by authenticating the user using passcode. Just paste this function in your project and call this function before authenticating user using Touch ID.

If it returns true run Touch ID authentication and if it fails due to biometry lock out than it will ask user to enter iPhone passcode to unlock biometry. This will happen within the app.

func isBiometryReady() -> Bool
{
    let context : LAContext = LAContext()
    var error : NSError?

    context.localizedFallbackTitle = ""
    context.localizedCancelTitle = "Enter Using Passcode"

    if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error)
    {
        return true
    }

    if error?.code == -8
    {
        let reason: String = "TouchID has been locked out due to few fail attempts. Enter iPhone passcode to enable touchID."
        context.evaluatePolicy(LAPolicy.deviceOwnerAuthentication,
                               localizedReason: reason,
                               reply: { (success, error) in

            return false
        })

        return true
    }

    return false
}
Dayna answered 10/8, 2017 at 12:8 Comment(0)
C
7

Touch ID, once locked-out due to incorrect tries, will be locked until the user enters the passcode. So there is no set time. The only way to unlock will be the passcode from this point onwards and there is no way to force an unlock, for obvious reasons.

Cyndicyndia answered 30/1, 2017 at 11:40 Comment(7)
But is it impossible to know how long to wait for unlock after lock it? I mean when you fail X times with biometrics and then fail X times with passcode, iPhone locks both methods, but I cant see how many time i have to wait for unlock it.Rositaroskes
You are not informed about the amount of time the phone is locked for. There is absolutely no way to know that information. Secondly, if you are trying to determine this in your app, you're probably going about the problem the incorrect way.Cyndicyndia
there is no way to handle this ??Isochronize
@shaqirsaiyed - There are ways to handle this. There is however, no way to override the security feature.Cyndicyndia
@RobertJ.Clegg by handle you mean we can show some alert to user right ? Like if user is locked out after few attempts then...Isochronize
@shaqirsaiyed Yeah, you could do that. However I think it would be pointless as the user would know that they're locked out - the OS displays an alert after no many wrong tried.Cyndicyndia
@RobertJ.Clegg ok. Though I checked when user go to settings and enter passcode once then it unlocks Touch ID.Isochronize
Z
-1

A restart would force the use to enter the credentials and upon successfully verifying it, the lockout is withdrawn. So in a nutshell - restart your device.

Zing answered 26/10, 2022 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.