Face ID for Xcode 9 GM unable to evaluate

I'm running Xcode 9 GM with iPhone X in simulator however evaluatePolicy for Face ID keeps failing. Is there a setting I am missing to use this new feature?

  • Xcode 9 GM
  • Simulator device iPhone X

    Hardware > Face ID > Enrolled

  • Deployment Target 11.0


Below is the code referenced from docs

let myContext = LAContext()
let myLocalizedReasonString = <#String explaining why app needs authentication#>

var authError: NSError?
if #available(iOS 8.0, macOS 10.12.1, *) {
    if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
        myContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: myLocalizedReasonString) { success, evaluateError in
            if success {
                // User authenticated successfully, take appropriate action
            } else {
                // 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
    }
} else {
    // Fallback on earlier versions
}
Answered by Engineer in 259735022

FaceID does not work in the Xcode 9 GM due to a framework bug.


For now the best thing to do is to test on an iPhone 8 and ensure everything works with Touch ID.

Get same error on Xcode 9, iOS11, on iPhone X simulator. Auth error description =

Error Domain=com.apple.LocalAuthentication Code=-6 "Biometry is not available on this device."

Even if Simulator has Face ID enrolled.

The LABiometryType = 0 which is None, where 2 = FaceID, and 1 = TouchID.

I don't know if LAContext needs another parameter or something to test for FaceID verses TouchID or not, but it looks like this is still in beta for this feature, and it doesn't work yet.

Looks like this release doesn't support LAContext authentication for iPhone X.

It does work on iPhone < 8, which is Touch ID enrolled.

At least we got the new iPhone X simulator!

Yup dead on arrival !

Yup. I’m also experiencing the same bug. Interestingly, this isn’t even mentioned in the release notes for Xcode 9. As a matter of fact, Face ID is not mentioned even once in the release notes document.

Accepted Answer

FaceID does not work in the Xcode 9 GM due to a framework bug.


For now the best thing to do is to test on an iPhone 8 and ensure everything works with Touch ID.

Thanks for the update, do keep us updated if there's a change before the official release.

For now the best thing to do is to test on an iPhone 8 and ensure everything works with Touch ID.

^Does that include both LocalAuthentication and Keychain ACLs?

Did anyone check this again with new Xcode 9 released today?

No change - just checked.

Face ID still didn't works in XCode 9.0.

b/c it's the same build number

XCode 9.0 GM build (9A235) = XCode 9.0 (9A235)

The context.biometryType = .none

Yes.

Does a radar ticket need to be raised for this as it seems to be a known issue?

Is there an ETA on a fix in the framework?


I haven't been able to get any value from this property, it always returns none on devices with ios11 and also iPhone8 simulator.

Xcode 9.1 beta came out today in which this is now fixed. All Face ID options now work in the simulator.

Hi Matty,

How did you manage to avoid the alert saying "This app was designed to use Touch ID and may not fully support Face ID"?

Thanks

Matteo

Face ID now works with the iPhone X simulator in the Xcode 9.1 / iOS 11.1 beta.


Note that, like Touch ID, Face ID can be used with LocalAuthentication.framework in the simulator. Using biometrics to control access to keychain items does not work in the simulator.


Also note that the iOS 11 SDK requires adding a usage string for Face ID with the key NSFaceIDUsageDescription (aka Privacy - Face ID Usage Description) to your app's Info.plist.


In the simulator, the Face ID permissions alert will show "This app was designed to use Touch ID and may not fully support Face ID" if that key is missing. On an actual device, your app will crash the same as if any other required usage string is missing.


Existing apps linked against older SDKs should work fine with Face ID.


On a related topic, the same APIs that work with Touch ID also work with Face ID. The fact that the symbols in the API contain the text "TouchID" doesn't matter: they work with both biometric methods.


This includes kSecAccessControlTouchIDCurrentSetOnly. The difference is only one face may be enrolled, so either deleting the face or enrolling a new one will do the same thing as adding or removing fingers from Touch ID.


--gc

Face ID for Xcode 9 GM unable to evaluate
 
 
Q