firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Token mismatch using iOS 18 Beta 1

Open Meyssam120 opened this issue 1 year ago • 6 comments

Description

I'm getting the following error when running my app on iOS 18 and requesting phoneAuthentication: Error Domain=FIRAuthErrorDomain Code=17048 "Token mismatch" UserInfo={NSLocalizedDescription=Token mismatch, FIRAuthErrorUserInfoNameKey=INVALID_APP_CREDENTIAL}. Before the update to iOS 18 everything worked normally. I triple checked the configuration and everything should be okay on my side. Everything's untouched except the iOS version. Strangely I could fix the issue by changing .prod -> .unknown in Auth.auth().setAPNSToken(deviceToken, type: .unknown) Messaging.messaging().setAPNSToken(deviceToken, type: .unknown)

Reproducing the issue

No response

Firebase SDK Version

10.28.0

Xcode Version

16.0 Beta (16A5171c)

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication, Firestore, Messaging, Storage

Targeted Platforms

iOS

Relevant Log Output

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

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

No response

If using CocoaPods, the project's Podfile.lock

No response

Meyssam120 avatar Jun 17 '24 18:06 Meyssam120

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Jun 17 '24 18:06 google-oss-bot

Thanks for reporting, @Meyssam120. I tried to reproduce the issue on iOS 18 beta, but I can't get the same behavior. You mentioned that the issue was fixed by changing the APNs token type to .unknown, in which the actual token will be auto detected from your provisioning profile. The error you encountered usually happens when the APNs device token is either incorrect or doesn't match the certificate uploaded in the console.

With this, could you verify the following:

  • Check if the bundle ID in your app is the same as the bundle ID registered in the console (Check Project Settings -> Your App for the bundle ID registered)
  • Check that the uploaded APNS certificate is correct and up-to-date
  • Download an updated GoogleService-Info.plist and add it to your app
  • Verify if the APNs device token is not expired
  • Verify if your App ID and Team ID are setup correctly

rizafran avatar Jun 20 '24 13:06 rizafran

Hi @rizafran . For authentication I use an auth-key instead of a certificate. That's why I thought it must be .prod. I've checked all of your points and can confirm, that they are all set up correctly. In fact I downloaded a new .plist file before submitting this issue, because I thought it would solve it, which it didn't. Btw. I assume that the auth-key is correct and valid, because I am able to send a bunch of push notifications to my devices.

Hope that helps you

Meyssam120 avatar Jun 20 '24 13:06 Meyssam120

Thanks for verifying, @Meyssam120. May I know if the issue occurred to all users or just in a specific region?

rizafran avatar Jun 21 '24 19:06 rizafran

The app is not public yet, so I've only experienced myself in Germany.

Meyssam120 avatar Jun 21 '24 19:06 Meyssam120

@Meyssam120, is it possible for you to provide a sample app that reproduces the issue? Also, are you reproducing it using a simulator or a physical device?

rizafran avatar Jun 25 '24 14:06 rizafran

Hey @Meyssam120. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Jul 09 '24 01:07 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@Meyssam120 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Jul 16 '24 01:07 google-oss-bot