禁用回退选项时,iOS中FaceID/TouchID的最大尝试次数?

禁用回退选项时,iOS中FaceID/TouchID的最大尝试次数?,ios,objective-c,touch-id,face-id,lacontext,Ios,Objective C,Touch Id,Face Id,Lacontext,我正在使用以下代码将FaceID/TouchID集成到我的应用程序中。因为我不需要“输入密码”的回退选项,所以我不确定在这种情况下FaceID/Touch ID的最大尝试次数。为了禁用回退,我提供了如下代码: myContext.localizedFallbackTitle = @""; 生物测量集成的代码为: - (void)authenicateButtonTapped{ LAContext *myContext = [[LAContext alloc]

我正在使用以下代码将FaceID/TouchID集成到我的应用程序中。因为我不需要“输入密码”的回退选项,所以我不确定在这种情况下FaceID/Touch ID的最大尝试次数。为了禁用回退,我提供了如下代码:

myContext.localizedFallbackTitle = @"";
生物测量集成的代码为:

    - (void)authenicateButtonTapped{
    LAContext *myContext = [[LAContext alloc] init];
    NSError *authError = nil;
    NSString *myLocalizedReasonString = @"Touch ID Test";
    myContext.localizedFallbackTitle = @"";
    
    if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
        [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                  localizedReason:myLocalizedReasonString
                            reply:^(BOOL success, NSError *error) {
            NSLog(@"success");
            
            if (success) {
                NSString *str = @"You are the owner of device";
                NSArray * result = [[NSArray alloc] initWithObjects:str,nil];
                dispatch_async(dispatch_get_main_queue(), ^{
               // executeClosure(callBack, result, NO);
                });
            } else {
                switch (error.code) {
                    case LAErrorAuthenticationFailed:
                        NSLog(@"Authentication Failed");
                        break;
                        
                    case LAErrorUserCancel:
                        NSLog(@"User pressed Cancel button");
                        break;
                        
                    case LAErrorUserFallback:
                        NSLog(@"User pressed Enter Password");
                        break;
                        
                    case LAErrorPasscodeNotSet:
                        NSLog(@"Passcode Not Set");
                        break;
                        
                    case LAErrorBiometryNotAvailable:
                        NSLog(@"Touch ID not available");
                        break;
                        
                    case LAErrorBiometryNotEnrolled:
                        NSLog(@"Touch ID not Enrolled or configured");
                        break;
                        
                    default:
                        NSLog(@"Touch ID is not configured");
                        break;
                }
                NSArray * result = [[NSArray alloc] initWithObjects:error.localizedDescription,nil];
                NSLog(@"Failure error: %@", result);
                NSLog(@"biometry disabled Error code %ld", (long)error.code);
                
                
                dispatch_async(dispatch_get_main_queue(), ^{
              //  executeClosure(callBack, result, NO);
                    // Rather than show a UIAlert here, use the error to determine if you should push to a keypad for PIN entry.
                    [self presentAlertControllerWithMessage:error.localizedDescription];
                });
            }
        }];
    } else {
        NSArray * result = [[NSArray alloc] initWithObjects:authError.localizedDescription,nil];
        dispatch_async(dispatch_get_main_queue(), ^{
            NSLog(@"Failure when biometry hardware not there%@",result);
            NSLog(@"biometry hardware Error code %@", authError);
        //     executeClosure(callBack, result, NO);
            // Rather than show a UIAlert here, use the error to determine if you should push to a keypad for PIN entry.
            [self presentAlertControllerWithMessage:authError.localizedDescription];
        });
        
    }
}
我可以找到一份文件,其中提到:

此图显示在3次触摸ID失败和2次FaceID尝试失败后。操作系统提供了一个回退,但因为我不想要回退选项

  • 我通过提供空字符串
    myContext.localizedFallbackTitle=@''禁用了它。在这种情况下
    TouchID/FaceID的最大尝试次数是多少
  • FaceID/TouchID在5分钟后将被禁用意味着什么 全系统的失败尝试?是5张脸和5张脸吗 单独触摸ID?请帮助我理解这一点

  • 设备具有FaceID或TouchID。对于任何给定的本地身份验证请求,它在尝试3次后返回密码。5次生物识别尝试失败后,系统范围内禁用所有生物识别认证;ie甚至不会提示用户进行生物特征认证。一旦您进行任何本地身份验证,系统将提示他们输入密码request@Paulw11谢谢你的解释。但当前已禁用我的密码选项,并分配了一个空字符串。那么在这种情况下会发生什么呢?试试看。我的猜测是,不管怎样,它要么会请求密码,要么会立即失败。您会禁用密码回退吗?这是用户体验的一个重要部分,但如果我有设备密码,我可以更改生物特征注册,因此消除密码除了让用户更难之外没有任何作用。此外,用户可能没有生物识别设置,所以提供密码至少可以给他们一些安全性,这就是Android。没有理由不在iOS上提供正确的体验。iOS用户希望应用程序以iOS方式运行