Allow Face ID permission alert

11,360

It appears that you need to add the NSFaceIDUsageDescription to your Info.plist in order to support Face ID.

Also, the simulator alert is only for simulator, without that Info.plist key, the app apparently should crash on a real device without it.

Thanks to these dudes for helping me learn this - What is NSFaceIDUsageDescription - Face ID Usage Description Info.plist key?


Protip:

Prior to the permission prompt, [LAContext canEvaluatePolicy:error:] returns YES for biometrics if the device is capable of it.

iOS won't prompt the user for permission until the first call to [LAContext evaluatePolicy:localizedReason:reply:].

If the user does not grant permission, then all future calls to canEvaluatePolicy will return NO (error Code=-6 "User has denied the use of biometry for this app."). This is an odd nuance.

Share:
11,360
beebcon
Author by

beebcon

Updated on June 14, 2022

Comments

  • beebcon
    beebcon about 2 years

    My app (running in iPhone X Simulator Xcode 9.0.1) is asking me for permission to use Face ID.

    The alert says:

    Do you want to allow <appName> to use Face ID? This app was designed to use Touch ID and may not fully support Face ID.

    I was expecting that the few changes I made to the new APIs in the LocalAuthentication framework (e.g. biometryType) was supposed to basically work for Face ID.

    Is there something else I need to do to make it so my app is designed to fully support Face ID?

  • Luca Iaco
    Luca Iaco over 6 years
    regarding the error -6 "User has denied the use of biometry for this app" you may be interested in stackoverflow.com/a/47470580/3172445
  • AtomicBoolean
    AtomicBoolean over 6 years
    The app doesn't crash without NSFaceIDUsageDescription Test case: physical iPhone X debbger via Xcode 9.2 and iOS 11.2 SDK. Results: I see the message: "This app was designed to use Touch ID and may not fully support Face ID." and the app does not crash.
  • beebcon
    beebcon over 6 years
    @ChrisWoolfe edit - my mistake - perhaps they addressed the behavior in iOS 11.2? I would suggest you try 11.1 or 11.0 to ensure it won't crash
  • Guy S
    Guy S about 5 years
    Is there a way to check if the permission prompt was shown?