Created
September 29, 2015 06:29
-
-
Save jbristowe/eb22091aa0f4e8762c32 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var context = new LAContext(); | |
try { | |
if (context.canEvaluatePolicyError(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics)) { | |
context.evaluatePolicyLocalizedReasonReply(LAPolicy.LAPolicyDeviceOwnerAuthenticationWithBiometrics, | |
"Are you the device owner?", | |
function (success, error) { | |
if (error) { | |
// error; problem verifying identity | |
return; | |
} | |
if (success) { | |
// success; you are the device owner | |
return; | |
} | |
// failure; you are not the device owner | |
}); | |
} | |
} catch (e) { | |
// exception; your device cannot authenticate with Touch ID | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment