Skip to content

Instantly share code, notes, and snippets.

@jbristowe
Created September 29, 2015 06:29
Show Gist options
  • Save jbristowe/eb22091aa0f4e8762c32 to your computer and use it in GitHub Desktop.
Save jbristowe/eb22091aa0f4e8762c32 to your computer and use it in GitHub Desktop.
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