Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS 10测试版-TouchID登录不会弹出pin键盘_Ios_Objective C_Touch Id - Fatal编程技术网

iOS 10测试版-TouchID登录不会弹出pin键盘

iOS 10测试版-TouchID登录不会弹出pin键盘,ios,objective-c,touch-id,Ios,Objective C,Touch Id,在iOS 9.x中,在尝试5次(3次然后2次)生物识别登录后,iOS会自动弹出一个默认pin码屏幕。这在iOS 10测试版中不会发生。它只是没有通过“CaneValuePolicy”检查。是否有人知道这只是iOS 10测试版中的一个bug,或者我是否需要添加代码来支持pin码屏幕 代码如下: -(void)touchTester { LAContext *myContext = [[[LAContext alloc] init] autorelease]; NSError *au

在iOS 9.x中,在尝试5次(3次然后2次)生物识别登录后,iOS会自动弹出一个默认pin码屏幕。这在iOS 10测试版中不会发生。它只是没有通过“CaneValuePolicy”检查。是否有人知道这只是iOS 10测试版中的一个bug,或者我是否需要添加代码来支持pin码屏幕

代码如下:

-(void)touchTester {
    LAContext *myContext = [[[LAContext alloc] init] autorelease];
    NSError *authError = nil;

    NSString *myLocalizedReasonString = @"Sign on with TouchID\u00AE or enter password.";
    myContext.localizedFallbackTitle = @"Enter Password";

    self.touchIdActive = NO;
    if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
        [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                  localizedReason:myLocalizedReasonString
                            reply:^(BOOL success, NSError *error) {
                                if (success) {
                                    self.touchIdActive = YES;
                                    dispatch_async(dispatch_get_main_queue(), ^{

                                        NSLog(@"Launching loginUser");
                                        [self loginUser:YES];
                                    });
                                } else {
                                    self.touchIdActive = NO;

                                    NSString * errMsg = error.localizedDescription;
                                    if (![errMsg isEqualToString:@"Canceled by user."]) {
                                        dispatch_async(dispatch_get_main_queue(), ^{
                                            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
                                                                                                message:errMsg
                                                                                               delegate:self
                                                                                      cancelButtonTitle:@"OK"
                                                                                      otherButtonTitles:nil, nil];
                                            [alertView show];
                                        });
                                    }
                                }
                            }];
    } else {
        // This is where we go after lockout in iOS 10
        dispatch_async(dispatch_get_main_queue(), ^{
            UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
                                                                message:authError.localizedDescription
                                                               delegate:self
                                                      cancelButtonTitle:@"OK"
                                                      otherButtonTitles:nil, nil];
            [alertView show];
        });
    }
}
显示代码:

LAContext *myContext = [[LAContext alloc] init];
myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
NSError *authError = nil;
NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];

BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError];
if (isOK) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
              localizedReason:myLocalizedReasonString
        reply:^(BOOL success, NSError *error) {
            NSLog(@" 查看是什么情况 %@",error);
            TouchType typeState = TouchTypeOther;
            if (success) {
                NSLog(@"解锁成功");
            } else {
                if(error.code == -8){
                    dispatch_async(dispatch_get_main_queue(), ^{
                        LAContext *myContext = [[LAContext alloc] init];
                        myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
                        NSError *authError = nil;
                        NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];
                        BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&authError];
                        if (isOK) {
                            [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthentication  localizedReason:myLocalizedReasonString
                                reply:^(BOOL success, NSError *error) {
                                    NSLog(@" 查看是什么情况 %@",error);
                                }];
                        }
                    });
                }
            }
        }];
} else {

    if(authError.code == -8){
        dispatch_async(dispatch_get_main_queue(), ^{
            LAContext *myContext = [[LAContext alloc] init];
            myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
            NSError *authError = nil;
            NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];
            BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&authError];
            if (isOK) {
                [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthentication  localizedReason:myLocalizedReasonString
                    reply:^(BOOL success, NSError *error) {
                        NSLog(@" 查看是什么情况 %@",error);
                    }];
            }
        });
    }
    NSLog(@"%@",authError);
}
显示代码:

LAContext *myContext = [[LAContext alloc] init];
myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
NSError *authError = nil;
NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];

BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError];
if (isOK) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
              localizedReason:myLocalizedReasonString
        reply:^(BOOL success, NSError *error) {
            NSLog(@" 查看是什么情况 %@",error);
            TouchType typeState = TouchTypeOther;
            if (success) {
                NSLog(@"解锁成功");
            } else {
                if(error.code == -8){
                    dispatch_async(dispatch_get_main_queue(), ^{
                        LAContext *myContext = [[LAContext alloc] init];
                        myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
                        NSError *authError = nil;
                        NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];
                        BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&authError];
                        if (isOK) {
                            [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthentication  localizedReason:myLocalizedReasonString
                                reply:^(BOOL success, NSError *error) {
                                    NSLog(@" 查看是什么情况 %@",error);
                                }];
                        }
                    });
                }
            }
        }];
} else {

    if(authError.code == -8){
        dispatch_async(dispatch_get_main_queue(), ^{
            LAContext *myContext = [[LAContext alloc] init];
            myContext.localizedFallbackTitle = [InternationalControl localStringByKey:@"gesture_forget"];
            NSError *authError = nil;
            NSString *myLocalizedReasonString = [InternationalControl localStringByKey:@"touchHome"];
            BOOL isOK = [myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&authError];
            if (isOK) {
                [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthentication  localizedReason:myLocalizedReasonString
                    reply:^(BOOL success, NSError *error) {
                        NSLog(@" 查看是什么情况 %@",error);
                    }];
            }
        });
    }
    NSLog(@"%@",authError);
}

你有什么iOS Beta 10。我有7个。但是iOS10的每一个测试版都让我在这个夏天工作。请描述一下你的情况。你能展示一下你的代码吗?我今天刚加载了。电话打10。(14A5345a)。基本上,我在我的应用程序中添加了TouchID支持。它有一个“自动”功能,如果您连续三次未能通过生物特征验证,它将返回一个“超出自动重试限制”错误。如果您再试一次,但又两次未通过生物特征验证,iOS 10将返回“生物测定已锁定”错误。在iOS 9中,在后一种情况下,你会得到一个键盘,允许你重新输入你的TouchID pin。我有7个。但是iOS10的每一个测试版都让我在这个夏天工作。请描述一下你的情况。你能展示一下你的代码吗?我今天刚加载了。电话打10。(14A5345a)。基本上,我在我的应用程序中添加了TouchID支持。它有一个“自动”功能,如果您连续三次未能通过生物特征验证,它将返回一个“超出自动重试限制”错误。如果您再试一次,但又两次未通过生物特征验证,iOS 10将返回“生物测定已锁定”错误。在iOS 9中,后一种情况下,您可以使用键盘重新输入TouchID pin。