首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LAContext.biometryType始终返回LABiometryTypeTouchID

LAContext.biometryType始终返回LABiometryTypeTouchID
EN

Stack Overflow用户
提问于 2019-03-19 19:20:15
回答 1查看 87关注 0票数 0

我已经在我的项目中使用了TouchID,现在我正在尝试使用FaceId进行身份验证,并且我正在使用以下代码。

代码语言:javascript
复制
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
    if (![myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError])
    {
        NSLog(@"0001 , EVT, %@, %@, %@",[[self class] description], NSStringFromSelector(_cmd), [authError localizedDescription]);
        return NO;
    }
    
    if (@available(iOS 11.0, *))
    {
        if (myContext.biometryType == LABiometryTypeFaceID)
        {
            NSLog(@"0002 , EVT, %@, %@, FaceID Suppoted Device",[[self class] description],NSStringFromSelector(_cmd));
        }

		if (myContext.biometryType == LABiometryTypeTouchID)
        {
            NSLog(@"0002 , EVT, %@, %@, Touched Suppoted Device",[[self class] description],NSStringFromSelector(_cmd));
        }
    }

myContext.biometryType总是返回LABiometryTypeTouchID(1),但是iam使用的设备是iPad 11英寸,iOS 12.1.4 (只有faceid,没有touchid)。

但是如果我运行下面的evaluatePolicy: faceid UI就会被提示。但是即使在那之后,我得到了myContext.biometryType返回LABiometryTypeTouchID(1),你知道为什么它返回LABiometryTypeTouchID(1)而不是LABiometryTypeFaceID (2)吗?

代码语言:javascript
复制
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                  localizedReason:myLocalizedReasonString
                            reply:

注意--这在iPhoneX和iOS 12.1.4上工作的很好,但是在iPad 11英寸iOS 12.1.4上却不能工作,奇怪的是...

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-02 13:35:27

最终从苹果公司得到了以下答案。

看起来你的应用是基于iOS 11.xSDK构建的。在iOS 12之前,iPads的人脸识别功能被禁用,这就是为什么它被识别为触摸ID的原因。

请确保您使用最新的Xcode构建应用程序,这是针对iOS 12.xSDK的

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55239807

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档