//支持类型
+(TCTBiometryType)supportBiometryType{
if (VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
// 判断设备是否支持指纹识别
LAContext *lacontext = [[LAContext alloc] init];
if ([lacontext canEvaluatePolicy:VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")?LAPolicyDeviceOwnerAuthentication:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:NULL])
{
if (@available(iOS 11.0, *)) {
if (lacontext.biometryType == LABiometryTypeFaceID) {
return TCTBiometryTypeFaceID;
}else if (lacontext.biometryType == LABiometryTypeTouchID) {
return TCTBiometryTypeTouchID;
}else{
//未授权 或者不支持
return TCTBiometryTypeNone;
}
}else{
return TCTBiometryTypeTouchID;
}
}
}
return TCTBiometryTypeNone;
}
网友评论