FaceID窗口行为

时间:2017-12-22 05:49:49

标签: swift ios11 face-id

两次尝试FaceId失败后,弹出窗口不会自动关闭。是否有任何处理程序在所有不成功的尝试或任何控制FaceId的处理程序弹出后自动关闭FaceId。

弹出窗口的行为与touchId不同。

请帮忙。

代码如下: -

func authentication() {
        let localAuthenticationContext = LAContext()
        localAuthenticationContext.localizedFallbackTitle = “Failed Authentication”

        var authError: NSError?
if localAuthenticationContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {

            localAuthenticationContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reasonString) { success, error in

                if success {
                     print("Authentication Successful”);


                } else {
                    print("Authentication failure");
                    guard let error = error else {
                        return
                    }
                    let errorMessage = self.errorMessageForFails(errorCode: error._code)
                    print(errorMessage);

                }
            }
        } else {

            guard let error = authError else {
                return
            }
            let errorMessage = self.errorMessageForFails(errorCode: error._code)
            display(errorMessage)

        }
    }

0 个答案:

没有答案