如何通过编程方式获取面部身份验证失败?

时间:2018-06-05 12:36:21

标签: face-id

我编写了以下代码,但是当面部身份验证失败时,它没有显示" kLAErrorAuthenticationFailed"对于Face ID,为什么会这样?

{
    case kLAErrorAuthenticationFailed://-- Pass the test(sensor is working)
        NSLog(@"kLAErrorAuthenticationFailed");
        errorReason=@"Error Authentication Failed";
        break;
    case kLAErrorPasscodeNotSet://-- Skip test
        NSLog(@"kLAErrorPasscodeNotSet");
        errorReason=@"Error Passcode Not Set";
        break;
    case kLAErrorSystemCancel://-- Failed
        NSLog(@"kLAErrorSystemCancel");
        errorReason=@"Error System Cancel";
        break;
        // ***** Deprecate Method from iOS 11
        /*
    case kLAErrorTouchIDNotAvailable://-- Skip test
        NSLog(@"kLAErrorTouchIDNotAvailable");
        errorReason=@"Error Touch ID Not Available";
        break;
         */
    case kLAErrorBiometryNotAvailable://-- Skip test
        NSLog(@"kLAErrorBiometryNotAvailable");
        errorReason=@"Error Biometric Sensor Not Available";
        break;

        // ***** Deprecate Method from iOS 11
      /*
    case kLAErrorTouchIDNotEnrolled://-- Skip test// guide user to enroll the touch id
        NSLog(@"kLAErrorTouchIDNotEnrolled");
        errorReason=@"Error Touch ID Not Enrolled";
        break;
        */
    case kLAErrorBiometryNotEnrolled://-- Skip test// guide user to enroll the touch id
        NSLog(@"kLAErrorBiometryNotEnrolled");
        errorReason=@"Error Biometry Not Enrolled";
        break;
    case kLAErrorUserCancel://-- Skip test
        NSLog(@"kLAErrorUserCancel");
        errorReason=@"Error User Cancel";
        break;
    case kLAErrorUserFallback://-- Skip test
        NSLog(@"kLAErrorUserFallback");
        errorReason=@"Error User Fallback";
        break;
    case kLAErrorInvalidContext://-- Skip test
        NSLog(@"kLAErrorInvalidContext");
        errorReason=@"Error Invalid Context";
        break;
    case kLAErrorAppCancel://-- Skip test
        NSLog(@"kLAErrorAppCancel");
        errorReason=@"Error AppCancel";
        break;

        // ***** Deprecate Method from iOS 11
        /*
         case kLAErrorTouchIDLockout://-- Skip test
         NSLog(@"kLAErrorTouchIDLockout");
         errorReason=@"Error TouchIDLockout";
         break;
         */
    case kLAErrorBiometryLockout://-- Skip test
        NSLog(@"kLAErrorBiometryLockout");
        errorReason=@"Error Biometry Lockout";
        break;

    default:
        NSLog(@"default kLAErrorBiometryNotAvailable");
        errorReason=@"kLAErrorBiometryNotAvailable";
        break;
}

0 个答案:

没有答案