-1

when I turn off face id on the setting,I get a error as follow:

    LAContext *myContext = [[LAContext alloc] init];
    NSError *authError = nil;
    [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]

authError is "No identities are enrolled." This error does not indicate whether the phone is touch id or face id,how I determine whether the ios device is a face or a touch?

I have tried differnt iphone device,authError is "No identities are enrolled.". I can not determine whether the ios device is a face or a touch.

  • https://developer.apple.com/documentation/localauthentication/lacontext/2867583-biometrytype – Paulw11 Jun 05 '23 at 02:36
  • 1
    Does this answer your question? [How to programmatically check support of 'Face Id' and 'Touch Id'](https://stackoverflow.com/questions/46887547/how-to-programmatically-check-support-of-face-id-and-touch-id) – HangarRash Jun 05 '23 at 16:09

1 Answers1

0

The biometryType property of the LAContext object tells you what type of biometric authentication is available on the current device:

LAContext *myContext = [[LAContext alloc] init];
switch (myContext.biometryType) {
    case LABiometryTypeFaceID:
        // Do something with Face ID
    break;

    case LABiometryTypeTouchId:
       // Do something with Touch ID
    break;

    case LABiometryTypeNone:
       // Biometrics are not available
}
Paulw11
  • 108,386
  • 14
  • 159
  • 186