firebase-ios-sdk
firebase-ios-sdk copied to clipboard
Token mismatch using iOS 18 Beta 1
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
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
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
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
Thanks for verifying, @Meyssam120. May I know if the issue occurred to all users or just in a specific region?
The app is not public yet, so I've only experienced myself in Germany.
@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?
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!
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.