Xcode version: Xcode 11
Firebase SDK version: 6.9.0
Firebase Component: Messaging 4.1.5
For builds made signed with iOS 12 SDK and Xcode 10 we have no issues with push notifications but they are not being delivered for clean installed builds made with Xcode 11 (iOS 13 SDK).
Updating from build made with Xcode 10 (iOS 12 SDK) to build made with Xcode 11 causes no issues on push delivery.
This issue can be explained by the fact that along side iOS 13 SDK update there was a change that interfered with the way some libraries retrieved the device token and they reported issues and requested users to update.
Related SO: https://stackoverflow.com/questions/57839723/does-ios-13-has-new-way-of-getting-device-notification-token
We've tested on iOS 13 that notification should still work with the new payload change. If you can still reproduce the issue, please send us
a. the token
b. let us know which sender API you use to send the notification.
c. the payload you sent
d. the response you get after you sent the payload
Hi @chliangGoogle ,
we are using Firebase console to trigger push notifications. In further debugging I've found that setting 'FirebaseDataCollectionDefaultEnabled' to 'NO' in Info.plist file prevents FCM token to be used by default and the MessagingDelegate method
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String)
would not be called. But calling:
Messaging.messaging().fcmToken
anywhere in the code (AppDelegate will finish launching method for example) would trigger the didReceiveRegistrationToken method call and the push notifications would be received.
Is this by design or should 'FirebaseDataCollectionDefaultEnabled' setting be related only to analytics products? If that is not so, is there another way of triggering the FCM token usage with the 'FirebaseDataCollectionDefaultEnabled' setting set to NO.
Currently the desired behaviour can be achieved by calling Messaging.messaging().fcmToken with the 'FirebaseDataCollectionDefaultEnabled' set to NO but I couldn't find it documented or recommended in any way.
I am experiencing this issue as well, have you solved the problem?
@antekarin Yes, it is by default that when setting 'FirebaseDataCollectionDefaultEnabled' to 'NO', it will overwrite FCM's autoInitEnabled flag to NO, meaning FCM doesn't auto generate FCM tokens without developers's intentionally calling it. Which explains why when you call getFCMToken yourself, push notification start working again.
any update here?
Close the issue as this is expected behavior. If you encounter a different scenario as @antekarin described here, please file a separate issue.
our problem had to do with the Push Certificates. Any newly added app on a Firebase project (old or new), would only work if we used Prod and Sandbox PANS certificates. Our APNs Authentication Key (even though it is valid and works on multiple other projects), would not work. I assume something is broken on the backend when using the APNs Key
To Verify above we did the following:
We had to migrate App A, B, C from Project 1 to Project 2. App A, B & C on project 1 all were using the APNs Authentication Key with success (were linked a few weeks back).
Yesterday we removed App A,B,C from Project 1 and added them on Project 2 and used the APNs Authentication Key for the Cloud Messaging.
We kept on getting:
{
"@type": "type.googleapis.com/google.firebase.fcm.v1.ApnsError",
"statusCode": 403,
"reason": "InvalidProviderToken"
}
In pure desperation and frustration after trying a million things, we created a brand new project (Xcode & Firebase) and used that same APNs Key. Same error. I then moved App A back onto Project 1 (APNs Key was automatically linked when the app ID was added) and boom notifications worked again.
As a last resort we tried with manually created certificates, and suddenly everything worked. And this has been verified on App A, B & C on Project 2 as well as the Test Project I made.
This seems like a bug, @Andreas409 would you mind create a new issue here and assign to me?