我正在 iOS 上编写一个 Objective-c 应用程序,我需要检测是否设置了 Touch ID 而不显示身份验证对话框。我当然可以使用;
[myContext
evaluatePolicyAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString reply:^(bool succes, NSError
*error)
但这将是一个身份验证对话框。
好吧,原来是这么简单;
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Authenticate using your finger";
if ([myContext canEvaluatePolicyAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError])
{
//if you get here, touch id has been set up
TouchIDSetup = true;
}
关于ios - 检测 Touch ID 已启用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39850233/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |