LAContext evaluatePolicy not showing TouchID prompt

We are using LAContext evaluatePolicy API to show the TouchID prompt in our App.

  • If we place our finger for authentication, then we can see the TouchID prompt and it completes the authentication.
  • What's even more strange is that when we can't see the pop-up window, then shake the device can make it appear.


😐


A simple project with code below:

#import "ViewController.h"
#import 
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
    [super viewDidLoad];
}
- (void)viewDidAppear:(BOOL)animated{
    dispatch_async(dispatch_get_main_queue(), ^{
        LAContext *context = [[LAContext alloc] init];
        [context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:@"xxxx" reply:^(BOOL success, NSError *error) {
            dispatch_async(dispatch_get_main_queue(), ^{
                NSLog(@"Verify successful");
            });
        }];
    });
}
@end




iPhone 6s

iOS 13-beta6

iOS 13-bata1 same behavior

iOS 13-beta5 same behavior

Replies

This stange issue disappear when i update to iOS13.0(17A5556d)

I am on iOS 13.1 public beta 3 (17A5837a) and am still seeing this issue. The problem is that it doesn't happen every time. It does still happen though.

This is also happening to me on ios 13.1 beta 3, it seems to come and go and its completly random. I also noticed if you dont see the prompt just change orientation (in my case my ipad) and it will show up. It seems the view just sometimes doesnt show, I would file a bug report for it. Its weird i noticed it in ios 13 beta 1 then it went away completly , but now its back in ios13.1 beta 3. I also know its not just my app, other apps what use touch id, it randomly doesnt show also.

I submitted a bug report via their Feedback app. Probably wouldn't hurt if you all did as well.


It seems one workaround is to call evaluatePolicy twice. The second call will cancel and dismiss the first. If the first prompt happened to not show, the second seems to show everytime. If the prompt did show the first time, it will quickly display and then be dismissed and replaced with the second. I haven't found any other workarounds at this time.

i also submitted a feedback.

me too, do you have any solution?

I can confirm this bug still exists in iOS 13.1 (17A844) and iOS 13.1.1 (17A854).

Calling SecItemCopyMatchig is affected by this bug, too.


A physical shake leads the Touch-ID-prompt to show up. Unfortunatly, a simulated shake event (I've written a FakeShaker, which provokes a UIMotionEvent) doesn't work.

I've got the same issue on an iPhone 7 (iOS 13.1). It's not even the beta version. I'm using Valte (https://github.com/square/Valet) to manage TouchID unlock.

I see the same issue in iOS 13.1.1.

I fix this bug.


LAContext *context = [[LAContext alloc]init];

NSError *error;

if ([fallbackTitle isKindOfClass:NSString.class]) {

context.localizedFallbackTitle = fallbackTitle;

}else {

context.localizedFallbackTitle = @"";

}

BOOL canEvaluate = [context canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error];

if (canEvaluate) {

// It's working !!!

if (@available(iOS 13.0, *)) {

[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics

localizedReason:[self biometricsText]

reply:^(BOOL success, NSError * _Nullable error)

{

}];

}

[context evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics

localizedReason:[self biometricsText]

reply:^(BOOL success, NSError * _Nullable error)

{

//TODO:

}];

}

It appears that you are just simply calling it twice like I had mentioned. Or is this doing something else that I am not noticing?

https://forums.developer.apple.com/thread/121149#382237


The problem with this is that sometimes the prompt does display, and if that happens, then this code will display it again, causing the prompt to actually display twice.

Unfortunately, no. A not-so-great workaround is to call evaluatePolicy twice.

https://forums.developer.apple.com/thread/121149#382237

It looks like its being reported now by iphone news outlets, maybe this will bring some awareness to it and apple will look into it.


https://9to5mac.com/2019/09/30/ios-13-iphone-touch-id-login-bug/

Thanks for sharing! Hopefully they get on this soon.

Seems to be fixed in 13.2 beta 1.