firebase-admin-java icon indicating copy to clipboard operation
firebase-admin-java copied to clipboard

FirebaseMessaging.sendEach has a limit of 500 messages

Open andreandersson opened this issue 8 months ago • 0 comments

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

Read and understood.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: N/A
  • Firebase SDK version: 9.4.2
  • Library version: _____
  • Firebase Product: messaging (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

sendEach has a limit of 500 messages, this limit is probably a leftover from sendAll which no longer works. It's not really logical to have this limit anymore.

https://github.com/firebase/firebase-admin-java/blob/master/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java#L226

Steps to reproduce:

Create a list with over 500 messages / push notifications. Call FirebaseMessaging.sendEach with the list. An error is thrown that there is over 500 messages in the array. What happened? How can we make the problem occur? This could be a description, log/console output, etc.

Relevant Code:

    checkArgument(immutableMessages.size() <= 500,
        "messages list must not contain more than 500 elements");

https://github.com/firebase/firebase-admin-java/blob/master/src/main/java/com/google/firebase/messaging/FirebaseMessaging.java#L226

andreandersson avatar Jun 09 '25 12:06 andreandersson