-
-
Save tacryt-socryp/16bb050912b181cf96e6680cdea0d3c4 to your computer and use it in GitHub Desktop.
Touch ID 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
LAContext *myContext = [[LAContext alloc] init]; | |
NSError *authError = nil; | |
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) { | |
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics | |
localizedReason:@"Authenticate to access secure information" | |
reply:^(BOOL success, NSError *error) { | |
if (success) { | |
NSLog(@"User is authenticated successfully"); | |
} else { | |
NSLog(@"Authentication Fails"); | |
} | |
}]; | |
} else { | |
NSLog(@"Can not evaluate Touch ID"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment