Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当TouchID在iOS 9上被锁定时,LAContext.CaneValuePolicy返回true_Ios_Iphone_Touch Id - Fatal编程技术网

当TouchID在iOS 9上被锁定时,LAContext.CaneValuePolicy返回true

当TouchID在iOS 9上被锁定时,LAContext.CaneValuePolicy返回true,ios,iphone,touch-id,Ios,Iphone,Touch Id,我在iOS 9和iOS 10上玩LocalAuthentication。并注意到以下行为差异。在iOS 9中,如果我执行下面显示的代码,并使用错误的手指进行身份验证,导致touchID被锁定,则即使在Touch ID被锁定之后,call context.CaneValuePolicy也会返回true,然后对context.evaluatePolicy的调用会导致设备提示我输入设备密码 在iOS 10中,如果我锁定TouchID,CaneValuePolicy返回false,错误是有一个指示Tou

我在iOS 9和iOS 10上玩LocalAuthentication。并注意到以下行为差异。在iOS 9中,如果我执行下面显示的代码,并使用错误的手指进行身份验证,导致touchID被锁定,则即使在Touch ID被锁定之后,call context.CaneValuePolicy也会返回true,然后对context.evaluatePolicy的调用会导致设备提示我输入设备密码

在iOS 10中,如果我锁定TouchID,CaneValuePolicy返回false,错误是有一个指示TouchIDLockout的代码

TouchIDLockout是在iOS 9中引入的,所以我希望在iOS 9中得到该错误代码,但目前还没有。还有其他人经历过吗

@IBAction func test(_ sender : UIButton) {
    let context = LAContext()
    var error : NSError? = nil
    if  context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
            context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Boom", reply: { (success, error) in
                let code = (error as? LAError)?.code.rawValue
                sender.setTitle(String(code ?? 2), for: .normal)
            })
        }
    }

}

}

在苹果开发者论坛上查找到的是,这是iOS 9中的一个bug,在iOS 10中已修复