0

I am using the FCM service by sending notification message from my server to certain users. Basically I am expecting to send messages to 50k users at a time. I read somewhere that there is a limit of 1000 messages and perhaps a topic subscription is around it.

The problem is that it is not the same group of users. I check do query on my database and then I get a list of users that meet criteria. The number of users that meet criteria is different everytime and it will be around 50k users on avg (out of 250l users).

Currently I do this in a loop

   Message message = Message.builder().setAndroidConfig(AndroidConfig.builder().setTtl(3600 * 1000 * 24 * 7) // 7 days
        .setPriority(AndroidConfig.Priority.HIGH)

.setNotification(AndroidNotification.builder().setTitle("Update News")

.setBody("A news impacting you has been published on the app")

.build()).putData("Type", "Location").build())

String response = FirebaseMessaging.getInstance().send(message);

Is there any way I can sent notifications to my 50k users?

Thank you

EDIT

The question is not duplicate as the limit of the user case I am mentioning is not covered in the potential duplicate questions. I am sending message to ONE device per ONE send. So there are 50k Sends. @Doug(from Google) answer below implies that there is no limit as opposed to what the other questions. Therefore I needed a clarification on the answer

Snake
  • 14,228
  • 27
  • 117
  • 250
  • Possible duplicate of [Firebase FCM Usage Limits](https://stackoverflow.com/questions/37961625/firebase-fcm-usage-limits) – Dhaval Solanki Jun 12 '19 at 03:59
  • You can loop and send as many messages as you like. Are you observing something different? – Doug Stevenson Jun 12 '19 at 04:00
  • @DougStevenson I didn't observe an issue yet as testing this would require 50k devices which will only happen when we are in production (which we are anticpating this on the first day of launch). But I read on mutlipe SO posts that it has 1000 limit as well as in the google docs it says "We limit the number of in-progress message fanouts per project to 1,000". I am not sure if the keyword fanout means something different here. But are you saying that I can call send as in the code above 50k times with no issues/rejections? – Snake Jun 12 '19 at 04:18
  • The limit you are citing does not apply here. That's for topic and group messaging, which are you are not using. – Doug Stevenson Jun 12 '19 at 04:34
  • Awesome. Thanks Doug so I can do 50k send with no issues without the need to throttle or anything (theoretically) – Snake Jun 12 '19 at 04:37

0 Answers0