My iOS app receive push notifications from firebase only when "test on device"

Viewed 1076

I am trying to use Firebase for push notification in my iOS app. I followed the "set up an iOS client" guide from Firebase. And I found that my iOS app can not receive a notification when I send a message using target (user segment) from Firebase console. However, I can receive it when I use "Test on device" feature where I entered the FCM Registration Token of my iOS app.

Any idea why this could happen and how to fix it.

Thank you

3 Answers

Firebase takes a while to propagate the Token across their servers, so the solution is just to wait a bit (minutes) and you will receive the notification both ways

It was happening for one of our projects. FCM was only working with test device id or if the user subscribes to a topic.

We ended up making a new Firebase account and changed Firebase service files. After this, FCM started working as expected without any other change.

"Firebase Cloud Messaging provides two ways to target a message to multiple devices: Topic messaging, which allows you to send a message to multiple devices that have opted in to a particular topic. Device group messaging, which allows you to send a single message to multiple instances of an app running on devices belonging to a group. -- https://firebase.google.com/docs/cloud-messaging/ios/send-multiple --"

Perhaps, with new firebase projects, it is impossible to send notification to all devices without define device group or topic messaging. I hadn't to configure those things in my previous apps.

Related