我正在iOS上编写一个objective-c应用程序,我需要检测是否已设置Touch ID而不显示身份验证对话框。我当然可以用它来解决这个问题;
[myContext
evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString reply:^(bool succes, NSError
*error)
但这将是一个身份验证对话框。
答案 0 :(得分:0)
好的想通了,事实证明它简直令人尴尬;
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;
}