Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On iOS 13 the biometric authentication alert does not show on older phones

On older iPhones such as the 6, 6s etc. The biometric authentication dialogue/alert is hidden. If you press the home button on the iPhone to authenticate via a fingerprint it still works, but the dialogue/alert is hidden, which is a source of confusion for users.

Various sources (1) (2) have reported this as an iOS 13 bug.

This worked correctly on iOS 12, the issue started on iOS 13.

My biometric auth code looks like this and is fired in a view controller's viewDidAppear method:

    let localAuthContext = LAContext()
    var error: NSError?
    if localAuthContext.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) {
        localAuthContext.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "SIGNIN.TITLE.Login".localized) { [weak self] (success, error) in
            if success {
                // success
            } else {
                // failure
            }
        }
    } else {
        // can't evaluate policy
    }

So, do I need to change something in my code for iOS 13, or is this an Apple issue?

like image 208
Cloud9999Strife Avatar asked Nov 22 '25 05:11

Cloud9999Strife


1 Answers

It seems to be issue in processing. I've fixed this issue by showing it from main queue so it will surely show maybe after delay but it will not remain hidden.

DispatchQueue.main.async {

  if localAuthContext.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error) {
    localAuthContext.evaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, localizedReason: "SIGNIN.TITLE.Login".localized) { [weak self] (success, error) in
        if success {
            // success
        } else {
            // failure
        }
    }
  } else {
     // can't evaluate policy
  }

}
like image 182
Tallha Sarwar Avatar answered Nov 23 '25 22:11

Tallha Sarwar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!