Skip to content

Commit

Permalink
Add a comment about the max number of tokens for each multicast API
Browse files Browse the repository at this point in the history
  • Loading branch information
waisingyiu committed Feb 29, 2024
1 parent ffb1593 commit 73ba5e7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ case class BatchNotification(notification: Notification, token: List[String])

case class ChunkedTokens(notification: Notification, tokens: List[String], range: ShardRange, metadata: NotificationMetadata) {
def toNotificationToSends: List[IndividualNotification] = tokens.map(IndividualNotification(notification, _))

// the Firebase sendEachForMulticast API has a maximum limit of 500 tokens for each request
// so this grouping of 500 tokens must not be increased further
def toBatchNotificationToSends: List[BatchNotification] = tokens.grouped(500).map(BatchNotification(notification, _)).toList
}

Expand Down

0 comments on commit 73ba5e7

Please sign in to comment.