Created
November 25, 2019 13:43
-
-
Save r3ggi/4eb247c54976e893c6a86d86f58e5a5e to your computer and use it in GitHub Desktop.
[Bypassing biometrics article] SecuBank verification example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func startVerification(_ sender: Any) { | |
let myContext = LAContext() | |
let myLocalizedReasonString = "Verifying...." | |
var authError: NSError? | |
if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) { | |
myContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: myLocalizedReasonString) { (success, evaluateError) in | |
DispatchQueue.main.async { | |
if success { | |
self.verificationStatusLabel.text = "✅ Verification successful" | |
} else { | |
self.verificationStatusLabel.text = "❌ Verification failed" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment