简体   繁体   中英

Face ID on iPhone X

LABiometryType property is set only when canEvaluatePolicy succeeds for a biometric policy.

How to identify touch id or face id is available on device before enrolling? We want to show a message in app to user ie "Enroll touch id" or "Enroll face id" if the device is not enrolled yet. We do not want put any device specific code.

You can't tell before you try to enroll.

You should design your app so a user first authenticates with your fallback mechanism (assuming it's not just the PIN, but something like user/pwd) and then you call canEvaluatePolicy to ask them to enroll after that succeeds. If that doesn't fail with a -6 (not supported on device) error, then store a flag indicating that it's supported on the device. Configure your UI and login flow based on that stored setting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM