- 指纹登录简述
- #pragma mark 指纹识别
//指纹识别功能是 iphone 5S之后推出的.SDK是 iOS 8.0 推出!
//推出指纹识别功能的目的,是为了简化移动支付环节,占领移动支付市场.
- (void)fingerPrintIdentification
{
float version = [UIDevice currentDevice].systemVersion.floatValue;
if (version < 8.0 )
{
NSLog(@"系统版本太低,请升级至最新系统");
return;
}
LAContext *laCtx = [[LAContext alloc] init];
if (![laCtx canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:NULL]) {
NSLog(@"该设备不支持指纹识别功能");
return;
};
[laCtx evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"指纹登陆" reply:^(BOOL success, NSError *error) {
if (success) {
NSLog(@"指纹识别成功!");
} else {
NSLog(@"指纹识别错误,请再次尝试");
}
}];
}