4

I have Touch ID running on my app and just now it stopped working for about a dozen runs. I eventually drilled down and found that the error.code in the reply block was -1004.

LAContext *context = [[LAContext alloc] init];
context.localizedFallbackTitle = @"";
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:reason reply:replyBlock];

This was on a real device, not the simulator (obviously) but -1004 isn't any of the documented values:

#define kLAErrorAuthenticationFailed                       -1
#define kLAErrorUserCancel                                 -2
#define kLAErrorUserFallback                               -3
#define kLAErrorSystemCancel                               -4
#define kLAErrorPasscodeNotSet                             -5
#define kLAErrorTouchIDNotAvailable                        -6
#define kLAErrorTouchIDNotEnrolled                         -7

The problem cleared itself on my device without any action on my part, but this is puzzling. What does the -1004 error.code mean?

Paul Cezanne
  • 8,629
  • 7
  • 59
  • 90
  • 1
    Wow, 2 years later and somebody upvotes. That means that this still is happening. Yikes! – Paul Cezanne Apr 05 '17 at 14:30
  • 1
    That was me - it seems to mean "User interaction required": http://stackoverflow.com/questions/38854052/touchid-error-code-1004-nslocalizeddescription-user-interaction-is-required – Pelle Stenild Coltau Apr 30 '17 at 08:37
  • What user interaction was needed? – Paul Cezanne May 01 '17 at 00:14
  • Well, that is actually what is quite puzzling. We have an enterprise distributed app that is configured and resigned individually for different customers - however, when the same app is installed twice (with different bundleId) on the same device, the call to evaluatePolicy will return -1004 in one of the apps. We have of course made sure that the app is in the foreground, so I'm leaning towards this being an iOS bug... (running iOS 10.3.1) – Pelle Stenild Coltau May 01 '17 at 09:29
  • I am still facing the same issue. Do anyone have an answer for this? – Jincy Varughese Oct 19 '18 at 03:53
  • and another upvote in May of 2020. Must still be happening... – Paul Cezanne May 20 '20 at 12:56

0 Answers0