Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FCM: Message to multiple registration ids limit?

As per this quote I found:

  • registration_ids – Type String array – (Optional) [Recipients of a message] Multiple registration tokens, min 1 max 1000.

Is this the actual limit of device tokens I can send a single message to? And do messages to topics have the same limit?

ex:

{
  "to": [reg_token_01, reg_token_02, ..., reg_token_1000],
  "priority": "high",
  "data": {
    "title": "Hi Peeps!",
    "message": "This is a special message for only for you...  More details are available..."
  }
}

As always, thanks for the info and direction!

like image 802
studiobrain Avatar asked Sep 07 '16 16:09

studiobrain


People also ask

Is there a limit on Firebase messaging?

You can send up to 240 messages/minute and 5,000 messages/hour to a single device.


2 Answers

Update: For v1, it seems that registration_ids is no longer supported. It is strongly suggested that topics be used instead.


Seeing as FCM is based from the GCM core, the maximum number of registration tokens you can send to when using the registration_ids parameter is 1000. I'm pretty sure you did see that in the official documentation.

So if ever you still intend to use the registration_ids parameter but you need to send it to more than 1000, you can follow what was @Eran said in his answer here:

If you need to send the same message to more than 1000 Registration IDs, you simply split the sending process into groups of 1000 Registration IDs. Each group would be sent in a separate request to GCM server.


However, when it comes to topics, there is no limit. There used to be, but it was scrapped years ago. I have mentioned it my previous answers before:

  • Answer 1:

Nope. As per their blog last December 2015:

We’re now happy to announce that we’re allowing unlimited free topics for your app. This means app developers can place an unlimited number of devices within each topic and create an unlimited number of topics.

  • Answer 2:

Nope. Seeing that FCM has GCM as its core, there is no limit in the number of Topics for any app. There used to be a 1 million limit, but it was removed. You can refer to this Google Developers Blog for that.

Also, when creating a Topic in FCM, it would seem that it takes a day for it to be available, as per this post.

like image 156
AL. Avatar answered Sep 26 '22 16:09

AL.


Apparently, there are legacy API's to achieve it. See here Send FCM message to multiple registration tokens

The method sendToDevice accepts array of registration tokens

like image 39
zulkarnain shah Avatar answered Sep 28 '22 16:09

zulkarnain shah