I want to use TouchID in my application, which is only in landscape mode. Everything is in order, but the authentication notification is displayed only in portrait mode. what should I do?
Here is my code:
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = [[NSString alloc] initWithUTF8String: title];
if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:myLocalizedReasonString
reply:^(BOOL success, NSError *error) {
if (success) {
NSLog(@"Authenticated using Touch ID.");
} else {
if (authError.code == kLAErrorUserFallback) {
NSLog(@"User tapped Enter Password");
} else if (authError.code == kLAErrorUserCancel) {
NSLog(@"User tapped Cancel");
} else {
NSLog(@"Authenticated failed.");
}
}
}];
} else {
NSLog(@"Touch ID is not available: %@", authError);
}
source
share