Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 682
Michel Marqués Avatar asked Jan 30 '17 10:01

Michel Marqués


2 Answers

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 attemp. Enter iPhone passcode to enable touchID.";
                    context.evaluatePolicy(LAPolicy.deviceOwnerAuthentication,
                                           localizedReason: reason,
                                           reply: { (success, error) in

                                            return false

                    })

                    return true


                }

        return false
    }
like image 120
Prasad Patil Avatar answered Nov 11 '22 07:11

Prasad Patil


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.

like image 21
Robert J. Clegg Avatar answered Nov 11 '22 07:11

Robert J. Clegg