Answer the question
In order to leave comments, you need to log in
How to send a message to multiple recipients via FCM?
Hello!
Connected the FCM service (Firebase Cloud Messaging).
The documentation describes an example for sending a message to a single user. This is the "to" field. As you can see, it takes one line. Tried to substitute an array of strings there. Not a ride: asks to insert a line.
In the same documentation, there is a "multicast_id" parameter that is incomprehensible to me.
More precisely, the incomprehensible value of the parameter.
How can I send a message to multiple users at once?
Answer the question
In order to leave comments, you need to log in
When subscribing to receive notifications, subscribe the device to the topic
And when sending a message, you can just specify this topic and the message will reach all devices that have subscribed to this topic
{
"to" : "/topics/fresh-music-set",
"data" : {
"title" : "Вышел новый суперский сборник",
"text": "Лучшие треки первого века, такого ты еще не слышал",
"name" : "Музыка для сна"
"count" : 100
"id" : 7829,
"pictureUrl" : "http://cdnimg.zaycev.net/commonImage/packiePresentation/3917/top917.jpg"
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question