【问题标题】:Different fingerprints using Touch ID in ios [duplicate]在ios中使用Touch ID的不同指纹[重复]
【发布时间】:2017-11-22 06:02:32
【问题描述】:

我正在开发一个使用 Touch ID 的应用程序。我已将 Touch ID 集成到应用程序中,以验证用户访问某些应用程序元素,它工作正常。

LAContext *context = [[LAContext alloc] init];

NSError *error = nil;
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
    [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"Are you the device owner?" reply:^(BOOL success, NSError *error) {
          if (error) {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                              message:@"There was a problem verifying your identity."
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
              return;
          }
          NSLog(@"%@",context);
          if (success) {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success"
                                                              message:@"You are the device owner!"
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
          } else {
              UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                              message:@"You are not the device owner."
                                                             delegate:nil
                                                    cancelButtonTitle:@"Ok"
                                                    otherButtonTitles:nil];
              [alert show];
          }

      }];
} else {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                                    message:@"Your device cannot authenticate using TouchID."
                                                   delegate:nil
                                          cancelButtonTitle:@"Ok"
                                          otherButtonTitles:nil];
    [alert show];
}

现在,假设有 2 个指纹,比如 Alice 和 Bob。身份验证适用于两种指纹,没有任何问题。

但我需要显示哪个指纹用户已通过身份验证。

有什么方法可以访问吗?

【问题讨论】:

  • 我认为你做不到!

标签: ios touch-id lacontext


【解决方案1】:

你怎么知道哪个用户是哪个?它们没有名字,iOS 中也没有内置身份管理基础。

您只需要相信,如果添加指纹的人通过添加他们的指纹来信任其他人,他们就可以访问 TouchID 授权的所有内容。

【讨论】:

    猜你喜欢
    • 2017-07-05
    • 2014-10-29
    • 1970-01-01
    • 1970-01-01
    • 2017-06-05
    • 1970-01-01
    • 2022-07-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多