gpt4 book ai didi

ios - 通过 TouchID 调用方法进行身份验证后不起作用

转载 作者:行者123 更新时间:2023-11-29 02:26:41 30 4
gpt4 key购买 nike

在进行身份验证后,如果我按取消并设置 [buttonTouch setHidden:NO]; 出现,按钮不会立即出现,需要很长时间才能出现,尽管按钮事件正在运行。

我的代码:

if ([context canEvaluatePolicy: LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]){
NSLog(@"TouchID Available!");

[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"Authenticate for server login" reply:^(BOOL success, NSError *authenticationError){
if (success) {
[self dismissViewControllerAnimated:YES completion:nil];
//[self VerifyUserInfo:YES];
NSLog(@"Fingerprint validated.");
}else{
NSLog(@"Fingerprint validation failed: %@.", authenticationError.localizedDescription);
switch (authenticationError.code) {
case LAErrorAuthenticationFailed:
[self AlertsMessage:@"Authentication is failed"];
NSLog(@"Authentication Failed");
break;

case LAErrorUserCancel:
[buttonTouch setHidden:NO];
NSLog(@"User pressed Cancel button");
break;

case LAErrorUserFallback:
[buttonTouch setHidden:NO];
NSLog(@"User pressed \"Enter Password\"");
break;

default:
[self AlertsMessage:@"Touch ID is not configured"];
NSLog(@"Touch ID is not configured");
break;
}

NSLog(@"Authentication Fails");
}
}];

最佳答案

打电话

 dispatch_async(dispatch_get_main_queue(), ^{

[buttonTouch setHidden:NO];

});

关于ios - 通过 TouchID 调用方法进行身份验证后不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27442972/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com