Face ID failing from testflight but not locally when building with xcode 12.4

Viewed 476

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.

2 Answers

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.

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

Related