firebase-ios-sdk: Phone Auth not working in iOS 16 simulator.

Description

For our app, in order to login, we use Phone Authentication. When testing on any OS below iOS16 in the iOS Simulator, it works perfectly for both test numbers and live phone numbers.

But now with iOS16, it throws the following error:

“Error Domain=FIRAuthErrorDomain Code=17048 “Token mismatch” UserInfo={NSLocalizedDescription=Token mismatch, FIRAuthErrorUserInfoNameKey=INVALID_APP_CREDENTIAL}”

I’ve tried it in both Sandbox, Production & Unknown APNs environments, but nothing fixes it.

Reproducing the issue

Submit a number to Phone Authentication

 finalPhone = "+" + "12345678910"
        PhoneAuthProvider.provider(auth: Auth.auth()).verifyPhoneNumber(finalPhone, uiDelegate: nil) {
            verificationID, error in
            if let error = error {
                print(error)
                completion(false)
                return
            } else {
                UserDefaults.standard.set(verificationID, forKey: "authVerificationID")
                completion(true)
            }
        }

Firebase SDK Version

master

Xcode Version

14.0

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project’s Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project’s Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 7
  • Comments: 30 (10 by maintainers)

Most upvoted comments

@SaudElabdullah and @ashtoncofer, this bug only affects testing on iOS 16 simulator, you can point to the fix-apns-16 branch for testing, then revert it back when ready to release. That’s what I am doing at least, then I will udpate on Nov 15 when they released it.

Thanks for answering @morganchen12. I am fine with using notifications on sim, once it’s supported. But shouldn’t it revert to recaptcha when it fails like this? Also for testing it would be actually nice if we could switch between the two methods manually and test both scenarios separately.

Same for me. Looking forward to 10.2.0

Any way to push this release sooner?