Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 519
coder Avatar asked Feb 24 '21 22:02

coder


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.

like image 160
user9684 Avatar answered Oct 22 '22 13:10

user9684


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

like image 34
Retebitall Avatar answered Oct 22 '22 13:10

Retebitall