2

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 i.e. "Enroll touch id" or "Enroll face id" if the device is not enrolled yet. We do not want put any device specific code.

MasterGoGo
  • 98
  • 6
  • Have you confirmed this? Apples’s Documentation indicates that you can use `LAContext.biometryType` to determine the available biometry system (which may be `.none`) before attempting authentication. – Paulw11 Sep 29 '17 at 21:08
  • Yes confirmed. Please check documentation in code. – MasterGoGo Sep 29 '17 at 21:16

1 Answers1

3

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.

clarus
  • 2,455
  • 18
  • 19