我使用了touchuid 功能,但是在弹出的提示框里只有使用指纹而没有输入密码的选项。
LAContext *context = [[LAContext alloc]init];
NSError *err;
if([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&err]){
[context evaluatePolicy:LAPolicyDeviceOwnerAuthentication
localizedReason:@"此操作需要授权,请输入解锁密码或使用指纹授权"
reply:^(BOOL success, NSError * _Nullable error) {
if (error) {
if ( error.code == LAErrorAuthenticationFailed || error.code == LAErrorSystemCancel) {
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil
message:@"授权出错"
delegate:nil
cancelButtonTitle:@"确定"
otherButtonTitles:nil, nil];
[alert show];
});
}
}
if (success) {
dispatch_async(dispatch_get_main_queue(), ^{
}
}];
}else{
NSLog(@"touch id not available");
}
不管用LAPolicyDeviceOwnerAuthentication 还是
LAPolicyDeviceOwnerAuthenticationWithBiometrics 都是这样。
怎么样能有下图中的enter password的选项?
iOS 8.3 이후에는 없어질 것 같은데, Touch ID를 한 번 잘못 입력하면 "비밀번호 입력"이 표시됩니다
Touch ID 인증을 위해 “비밀번호 입력” 표시