Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LAContext *myContext = [[LAContext alloc] init];
- NSError *authError = nil;
- NSString *myLocalizedReasonString = <#String explaining why app needs authentication#>;
- if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
- [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
- localizedReason:myLocalizedReasonString
- reply:^(BOOL success, NSError *error) {
- if (success) {
- // User authenticated successfully, take appropriate action
- } else {
- // User did not authenticate successfully, look at error and take appropriate action
- }
- }];
- } else {
- // Could not evaluate policy; look at authError and present an appropriate message to user
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement