Firebase Messaging FCM Distribution over configurable time interval

Viewed 452

When you use FCM to send a push to all devices of a given app this can result in many users opening their apps at the same time which can lead to massive server polling resulting in load peaks.

Is there a convenient way to distribute a message over a given time interval for scheduled pushes?

2 Answers

Finally we found a possible way to archive the goal of a time based distribution by defining pseudo-random topics with a given range.

As an example the app calculates a random integer number between 0 and 9 and uses it as a postfix for a randomized segmentation ("segment_0" to "segment_9"). Now you can distribute the push by sending pushes to the defined segments programmatically or using the Firbase Console over a given timespan.

There is nothing built in that I know of to cause some pseudo-random distribution of delivery. But here are some options I can think of:

  1. From the Firebase console you can schedule the message to be delivered in the user's timezone. If you have a global audience, this means the delivery of the messages will be spread out globally.
  2. Through the API you can delivery a data-only message with the information. This message type is not automatically displayed by the system, but always delivered by your application code. your code can then hold the message and display it after a random delay.
Related