I'm implementing authentication in my app and allowing the user to authenticate using Touch ID. I also want to enable a fallback for when they want to enter a password instead, by having a "Enter Password" button.
The code I current have:
NSError *error = nil;
LAContext *context = [[LAContext alloc] init];
if ([context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
localizedReason:@"Login to My app"
reply:^(BOOL success, NSError *error) {
// do something
}
];
} else {
// do something
}
While the Touch ID part works, the "Enter Password" button isn't showing.
The only way I can get it to show is if I fail the touch authentication by using a different finger that isn't registered.
I'd rather not have to force the users to fail the authentication to show that button.
I've gone through several tutorials and blogs checking to see if I've missed anything and I haven't found anything.
From the pictures, it seems the "Enter Password" should be shown. I am using the 8.3 SDK on an iPhone with iOS8.2 and 8.3
I figured out that the "Enter password" button would appear if touch id does not recognize your finger on the first attempt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With