我正在开发一个使用 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。身份验证适用于两种指纹,没有任何问题。
但我需要显示哪个指纹用户已通过身份验证。
有什么方法可以访问它吗?