3

Description of error is below:

Error Domain=com.apple.LocalAuthentication Code=-1000 "Pending UI mechanism already set." UserInfo=0x17406b0c0 {NSLocalizedDescription=Pending UI mechanism already set.}

I am also trying Apple's Sample Example app and getting same error. Previously it was working fine, but it has stopped working suddenly ad not working. Please help.

I am using iPhone 6 with iOS 8.1

Dharma
  • 3,007
  • 3
  • 23
  • 38
Preet
  • 31
  • 3

2 Answers2

1

This code just worked fine for me.

LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"String explaining why app needs authentication";

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
              localizedReason:myLocalizedReasonString
                        reply:^(BOOL success, NSError *error) {
                            if (success) {
                                // User authenticated successfully, take appropriate action
                                NSLog(@"User authenticated successfully, take appropriate action");
                            } else {
                                // User did not authenticate successfully, look at error and take appropriate action
                                NSLog(@"User did not authenticate successfully, look at error and take appropriate action");
                            }
                        }];
} else {
    // Could not evaluate policy; look at authError and present an appropriate message to user
    NSLog(@"Could not evaluate policy: %@",authError);
}

Don't forget to import Local Authentication framework <LocalAuthentication/LAContext.h>. Hope this will solve your issue.

Akhil K C
  • 4,543
  • 4
  • 16
  • 21
  • I am trying Apple Sample App also on iPhone, but it is not working. It looks like a device issue. But there must be some mitigation steps to solve this. What if any customer faces this issue, will never be able to use a particular app with Touch ID. Everything else is working fine, I mean Touch ID for Device PIN, iTunes account. – Preet Dec 13 '14 at 01:18
  • I can't experience any issue as you said. Everything is fine with above code for me. But here, http://stackoverflow.com/questions/26463196/touch-id-causing-app-to-become-non-responsive, i found a question sounds similar to this. But i don't think the accepted answer is not a good programming technique. – Akhil K C Dec 15 '14 at 09:17
0

Try rebooting your phone.

I also started getting this error and decided to see if other apps were affected. I have both Dropbox and Mint set up for Touch ID. Sure enough Touch ID wasn't working for them either and they were falling back to passcodes.

I rebooted my phone and it started working again, so it would seem the Touch ID can bug out and stop working. I'm on iOS 8.2 btw.

I guess the proper way to handle this condition is like those apps do and fallback to password / passcode.

Code Baller
  • 71
  • 2
  • 4