Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show "Enter Password" for Touch ID authentication

Tags:

ios

touch-id

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.

Touch ID 1

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.

Touch ID 2

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.

  • Tutorial 1

Tutorial 1

  • Tutorial 2

Tutorial 2

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

like image 333
SunnySydeUp Avatar asked May 18 '15 03:05

SunnySydeUp


1 Answers

I figured out that the "Enter password" button would appear if touch id does not recognize your finger on the first attempt.

like image 77
Hussein Avatar answered Nov 15 '22 20:11

Hussein