我在应用程序商店中有一个使用Touch ID的iPhone应用程序.如果启用了Touch ID,则用户将对其进行身份验证,否则用户需要输入其PIN才能登录该应用程序.
IOS 10.1发布后,当我检查崩溃报告时,崩溃计数增加了.从崩溃报告中可以看出[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:],当我在Xcode中打开应用程序时,它正在关注[self dismissViewControllerAnimated:YES completion:nil];.
我写的代码如下:
-(void) showTouchIDAuthentication{
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Authenticate using your finger to access My Account Menu.";
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString
reply:^(BOOL success, NSError *error) {
if (success) {
NSLog(@"User is authenticated successfully");
[self dismissViewControllerAnimated:YES completion:nil];
} else {
}];
}
}
Run Code Online (Sandbox Code Playgroud)
当我在iPhone 6,IOS 10中测试时,一切正常.不知道如何模拟这个问题.
任何人都可以弄清楚我是否遗漏了什么?请帮我解决这个崩溃问题.