为什么 iOS 只显示 FaceID 的权限提醒?

Why iOS display a permission alert only for FaceID?

当我实现 FaceID 时,我在 Info.plist 上设置了 FaceID 使用说明,因此,每当用户第一次尝试使用 FaceID 时,iOS 都会显示询问 FaceID 权限的提示。

但是,我不确定为什么如果我使用 Touch ID,不会出现类似的警告 "Do you want to allow XXX to use Touch ID" 要求用户许可。出现的是这样的警报:

这种行为正常吗?或者如何使用 TouchID 显示该警报?

这是 Apple 有意做出的用户体验选择。它与 Face ID 的被动性质(只是继续看着设备)和用户将手指放在设备上的 Touch ID 传感器上的有意操作有关。如果没有插页式广告请求故意允许使用该功能,用户可能会无意中(成功地)使用 Face ID 进行身份验证,尽管可能并没有这样做的意图。

您在问题中详述的行为在 Logging a User into Your App with Face ID or Touch ID(强调我的)中有明确记录:

Set the Face ID Usage Description

In any project that uses biometrics, include the NSFaceIDUsageDescription key in your app’s Info.plist file. Without this key, the system won’t allow your app to use Face ID. The value for this key is a string that the system presents to the user the first time your app attempts to use Face ID. The string should clearly explain why your app needs access to this authentication mechanism. The system doesn’t require a comparable usage description for Touch ID.