Wednesday, November 22, 2017

Plan on using Face ID on iPhone X in your iOS app? You must include NSFaceIDUsageDescription in your Info.plist

I’ve already shipped an app that is accessing Face ID on iPhone X, but while testing an unrelated feature the other day, I saw the alert on the left. I thought I had read everything that I needed to about Face ID implementation, but this had slipped past me.

I parked it for a while, but I happened to open the docs on LAContext on an unrelated issue when I saw the Important information on the right.

When you click on NSFaceIDUsageDescription you see the description on the left. I didn't experience any forced app quitting behavior on device or simulator, but your experience may vary.

With NSFaceIDUsageDescription added to Info.plist, and a key of “Secure Account Access” like in the right screenshot, users will see a prompt like the one on the right when the app tries to access Face ID the first time.

Glad I caught this in the “one to fix all the iPhone X issues” release of the app I’m working on.