What is NSFaceIDUsageDescription - Face ID Usage Description Info.plist key?
Asked Answered
C

6

44

There is a new privacy NSFaceIDUsageDescription Info.plist key in the Xcode 9 GM where a developer supplies the usage description for the permissions alert. Does anyone have a link to docs on it? The plist view in Xcode summarizes it as:

Privacy - Face ID Usage Description

Cornellcornelle answered 19/9, 2017 at 20:41 Comment(1)
The only, more a less reference I found is: forums.developer.apple.com/thread/86779 no docs yetSobranje
G
44

Now further explained in the above mentioned forum (by an Apple employee) https://forums.developer.apple.com/message/265156:

Face ID requires adding a usage string 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.

Glazier answered 28/9, 2017 at 21:57 Comment(1)
It's a bit poor to have the simulator work without this key. As not owning an X you'd never know you've missed this until you ship an app.Coveney
T
29

maybe I'm later to the party but you can fix this just by adding this

<key>NSFaceIDUsageDescription</key>
<string>$(PRODUCT_NAME) Authentication with TouchId or FaceID</string>

to Project-Info.plist

Timid answered 15/4, 2020 at 17:10 Comment(1)
Is there a way to check and see which is supported so the string can only contain either Face ID or Touch ID?Jerold
H
3

Privacy - Face ID Usage Description (NSFaceIDUsageDescription) is string key, lets you describe the reason your app uses Face ID.

To protect user privacy, an iOS app that links on or after iOS 11 and that would access Face ID if the hardware supports it, must statically declare the intent to do so. Include the NSFaceIDUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access Face ID without a corresponding purpose string, your app may exit.

Note: This key is supported in iOS 11 and later.

Face-Id authentication is introduced for/with iPhone-X device and will work with iPhone-X only (Even no simulator)

With Xcode 9.0.1 & Xcode 9.2 beta - it seems found working

Ref. link to Apple Document - NSFaceIDUsageDescription
List of all available keys - Cocoa Keys

Hundredpercenter answered 23/10, 2017 at 12:24 Comment(0)
R
0

I have users that were reporting an app crash when the first TouchID alert shows. The fix was to test on the device and read the console (Xcode 9.4.1):

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSFaceIDUsageDescription key with a string value explaining to the user how the app uses this data.

Simply adding NSFaceIDUsageDescription by right clicking and "Add Row" in the root of the Info.plist and pasted NSFaceIDUsageDescription in and set it to YES.

The simulator isn't going to support FaceID so apps that use logins, keychain, and TouchID are affected if you don't add a one liner to the plist to support FaceID verification. The user will get an alert asking them to allow FaceID to log into your app by default so no coding required to support FaceID if you're already setup for TouchID.

Rachele answered 7/9, 2018 at 6:45 Comment(0)
Y
0

In the Xcode version 14.0.1, I can't add the required info to infoPlist using "Add Row" method. Rather I added the statement below manually;

/* Localized versions of Info.plist keys */

NSFaceIDUsageDescription = "This app wants to use your Face ID. Plaese Hit OK to activate Face ID.";

Don't forget to add that semicolon by the way otherwise you will get validation error.

Yseulta answered 3/10, 2022 at 9:6 Comment(0)
A
0

As per April 2024 what said above is not accurate/wrong (I am using Xcode 15.3 and iOS17 on iPhone 15)

  1. I have an app in production form months without that string on plist. it does work

  2. I read above and I downloaded: https://developer.apple.com/documentation/localauthentication/logging-a-user-into-your-app-with-face-id-or-touch-id

If You leave that key (sample untouched from Apple) it works and shows

enter image description here

  1. I removed that string and:
  • does run
  • does NOT crash
  • it simply asks for iPhone 6 digits code
Arachnoid answered 1/4, 2024 at 10:12 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.