iOS setup
Add a Face ID usage description to ios/<App>/Info.plist:
<key>NSFaceIDUsageDescription</key>
<string>Unlock your account with Face ID.</string>
iOS shows this string the first time the app asks for Face ID.
:::warning Without the key, Face ID resolves with not_available
iOS terminates an app that opens a Face ID prompt without NSFaceIDUsageDescription. To avoid the crash, authenticate checks for the key first and, on Face ID devices, resolves with not_available and the warning Add NSFaceIDUsageDescription to the app's Info.plist to use Face ID. Touch ID devices do not need the key.
:::
Requirements
- iOS 16 or later, the deployment target in the package's
Package.swift. optic_idis reported on iOS 17 and later, on Apple Vision Pro.
Testing on the simulator
A fresh simulator has no enrolled biometrics and no passcode, so the status methods return false and authenticate fails. Enroll Face ID with Features > Face ID > Enrolled, then use Matching Face or Non-matching Face while the prompt is open.