您的位置:首页 > 游戏 > 游戏 > 开个网络公司需要多少钱_惠州网站建设设计_小红书信息流广告投放_网络营销策划书的主要内容

开个网络公司需要多少钱_惠州网站建设设计_小红书信息流广告投放_网络营销策划书的主要内容

2025/2/24 12:10:35 来源:https://blog.csdn.net/qq_38779672/article/details/145618729  浏览:    关键词:开个网络公司需要多少钱_惠州网站建设设计_小红书信息流广告投放_网络营销策划书的主要内容
开个网络公司需要多少钱_惠州网站建设设计_小红书信息流广告投放_网络营销策划书的主要内容

1. info.plist中添加权限申请

<key>NSFaceIDUsageDescription</key>
<string>APP would like to use Face ID</string>
<key>NSBiometricUsageDescription</key>
<string>APP would like to use Touch ID</string>

2. 添加库

Build Phases → Link Binary With Libraries → LocalAuthentication.framework

3. 实现代码

#import <LocalAuthentication/LocalAuthentication.h>// 检查是否支持认证
-(BOOL) isSupportBiometricCheck {LAContext *context = [[LAContext alloc] init];NSError *error = nil;// 检查设备是否支持生物识别认证if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthentication error:&error]) {return true;} else {return false;}
}// 认证
// title:标题 eg.生物识别登录
// subTitle:副标题 eg.使用生物识别凭证登录
// negativeText:取消文本 eg.取消
- (void)biometricCheck:(CallSN)cbSn title:(NSString *)titlesubTitle:(NSString *)subTitlenegativeButton:(NSString *)negativeText {LAContext *context = [[LAContext alloc] init];NSString *localizedReason = [NSString stringWithFormat:@"%@\\n%@", title, subTitle];[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationlocalizedReason:localizedReasonreply:^(BOOL success, NSError * _Nullable error) {dispatch_async(dispatch_get_main_queue(), ^{if (success) {NSLog(@"认证成功");} else {NSLog(@"认证失败,原因:%@", error.description);}});}];
}

目前来看LAPolicyDeviceOwnerAuthentication优于LAPolicyDeviceOwnerAuthenticationWithBiometrics,因为LAPolicyDeviceOwnerAuthenticationWithBiometrics在验证失败时,需要重新输入一次锁屏密码或者调用LAPolicyDeviceOwnerAuthentication输入密码才可以再次被正常调用。否则直接返回生物特征已锁定,而引起认证失败。

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com