【问题标题】:Is it possible to get the value of USE TOUCHID FOR iPhone unlock in default settings是否可以在默认设置中获取 USE TOUCHID FOR iPhone 解锁的值
【发布时间】:2016-04-19 14:23:38
【问题描述】:

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

【问题讨论】:

  • 你需要什么?您可以获取 Touch ID 是否已为设备配置或支持或不使用 iOS SDK...!
  • 不,我只想知道默认设置中切换按钮的状态 > TouchID 和密码 > iPhone 解锁。我们能得到这些数据吗?

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


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    有方法 canEvaluatePolicy: error:

    但这会告诉您 TouchId 是已配置/启用还是未配置/未启用。如果你想为你的应用检查 touch Id 的可用性,你可以使用 canEvaluatePolicy: error:

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

    // 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

    【讨论】:

      【解决方案3】:

      我不知道您为什么想知道这一点,但是您可以随时检查设备是否支持 TouchID,以及它是否已由用户设置。为此,您可以创建一个LAContext(本地身份验证上下文)并调用函数canEvaluatePolicy:error:。这就是我认为您可以通过应用程序了解给定 iPhone 上的 TouchID 设置的全部信息。我希望这会有所帮助:)

      【讨论】:

        猜你喜欢
        • 2011-04-23
        • 1970-01-01
        • 2019-08-24
        • 2014-10-15
        • 1970-01-01
        • 2021-07-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多