是否可以在默认设置中获取USE TOUCHID FOR iPhone解锁的值

时间:2016-01-14 10:00:39

标签: ios objective-c authentication settings touch-id

是否可以访问默认设置> TouchID&密码> iPhone解锁切换值。

enter image description here

3 个答案:

答案 0 :(得分:3)

据我所知,这是不可能的。

答案 1 :(得分:2)

NO。无法知道用户是否选择使用TouchID解锁手机。

有方法canEvaluatePolicy:错误:

但是这会告诉您TouchId是配置/启用还是未配置/未启用。如果您想检查应用程序的触摸ID的可用性,可以使用canEvaluatePolicy:error:

  

- (void)canEvaluatePolicy {
      LAContext * context = [[LAContext alloc] init];
      __block NSString *消息;       NSError *错误;       BOOL成功;

// test if we can evaluate the policy, this test will tell us if Touch ID is available and enrolled 
success = [context canEvaluatePolicy: <BR>LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]; 
if (success) { 
    message = [NSString stringWithFormat:@"Touch ID is available"]; 
} 
else { 
    message = [NSString stringWithFormat:@"Touch ID is not available"]; 
} 


[super printMessage:message inTextView:self.textView]; 
     

}

您可以从developer.apple.com网站找到完整的代码:

https://developer.apple.com/library/content/samplecode/KeychainTouchID/Listings/KeychainTouchID_AAPLLocalAuthenticationTestsViewController_m.html

答案 2 :(得分:0)

I don't know why you would want to know that however, you can always check if the device supports TouchID and if it has been setup by the user. You do this by creating an LAContext (Local Authentication Context) and calling the function canEvaluatePolicy:error:. That is all I think you can find out about the TouchID settings on a given iPhone through an app. I hope this helps a little :)