|
|
@ -13,6 +13,8 @@ class BiometricAuthenticationWireframe { |
|
|
|
weak var view: UIViewController! |
|
|
|
var completion: ((String?) -> ())? |
|
|
|
var information: String? |
|
|
|
|
|
|
|
var policy: LAPolicy = .deviceOwnerAuthentication |
|
|
|
} |
|
|
|
|
|
|
|
extension BiometricAuthenticationWireframe: BiometricAuthenticationWireframeInput { |
|
|
@ -40,10 +42,10 @@ extension BiometricAuthenticationWireframe: BiometricAuthenticationWireframeInpu |
|
|
|
|
|
|
|
var error: NSError? |
|
|
|
let msg = "Confirm your fingerprint or face to authenticate." |
|
|
|
let deviceAuth = LAPolicy.deviceOwnerAuthentication |
|
|
|
// let deviceAuth = LAPolicy.deviceOwnerAuthenticationWithBiometrics |
|
|
|
|
|
|
|
if context.canEvaluatePolicy(deviceAuth, error: &error) { |
|
|
|
context.evaluatePolicy(deviceAuth, localizedReason: msg, reply: { (success, err) in |
|
|
|
if context.canEvaluatePolicy(policy, error: &error) { |
|
|
|
context.evaluatePolicy(policy, localizedReason: msg, reply: { (success, err) in |
|
|
|
if success { |
|
|
|
DispatchQueue.main.async { |
|
|
|
self.completion?(nil) |
|
|
|