5

FaceID allows storage of credentials but not retrival. I'm seeing this error when inspecting via the xcode console. If I run the same code from xcode locally everything works fine.

returned Error Domain=com.apple.LocalAuthentication Code=-1004 "Caller is not running foreground."

To make it even more strange if I install a different version from testflight and then reinstall the original broken version it starts working again.

coder
  • 1,274
  • 1
  • 13
  • 19
  • I have two projects on test flight ( Staging/Production). One of them is producing this error while the other is not. Very strange – Retebitall Mar 02 '21 at 20:10
  • 1
    Seems to happen if i download several apps from testflight at the same time. Not sure if this issue would come up if i publish to production or not. – coder Mar 05 '21 at 21:46
  • sadly, it came up for us in production for two different products – Retebitall Mar 09 '21 at 02:25
  • Same issue here, only happening in our production release and not in our testing release on a staging domain with a different name. Both have a Testflight beta version. – MaT Apr 07 '21 at 15:44
  • Surprised it would happen in a production environment. – coder Apr 08 '21 at 19:26
  • Did you find solution on it @coder – Anita Nagori Aug 06 '21 at 16:13

2 Answers2

3

We've encountered this error as well in our app, but as it turned out, it was caused by having multiple apps with the same Product Name on one device.

In our case this means that we will not have this on our live app, but this came up on devices of our tester.

user9684
  • 46
  • 3
  • Ensuring the Product Name is unique appears to have fixed the issue. Specifically, I changed the app's target name to be the same as the bundle id. – coder Apr 08 '21 at 19:25
2

This error always comes up for me as -1004 so I added a check to my error handling block like this:

...
if let error = authError as? LAError {
    if (error.code.rawValue == -1004) { //bizarre facial recognition error
        completion(true, //do some code..)
    }
    completion(false, error)
}...

works on my production application

Retebitall
  • 475
  • 5
  • 8