我正在iOS上编写Objective-C应用程序,我需要检测是否已设置Touch ID,而未显示身份验证对话框。我当然可以用它弄清楚;
[myContext
evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString reply:^(bool succes, NSError
*error)
但这将是一个身份验证对话框。
最佳答案
Ok弄清楚了,事实证明这很简单。
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Authenticate using your finger";
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError])
{
//if you get here, touch id has been set up
TouchIDSetup = true;
}
关于ios - 检测触摸ID已启用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39850233/