Is the only way to broadcast same message to multiple recipients to send multiple messages like this:
[{
“to”: “ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]”,
“sound”: “default”,
“body”: “Hello world!”
}, {
“to”: “ExponentPushToken[yyyyyyyyyyyyyyyyyyyyyy]”,
“sound”: “default”,
“body”: “Hello world!”
}]?
Or is there a way to send one message that will contain multiple push tokens? E.g. something like this:
{
“to”: [“ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]”, “ExponentPushToken[yyyyyyyyyyyyyyyyyyyyyy]”],
“sound”: “default”,
“body”: “Hello world!”
}
Hey @ilebedie and @gopidon! Thanks for checking out Expo, here is the official answer:
The HTTP request body must be JSON. It may either be a single message object or an array of up to 100 messages. We recommend using an array when you want to send multiple messages to efficiently minimize the number of requests you need to make to Expo servers. This is an example request body that sends two messages:
So you can use this example to send the same message, and represent that message with a javascript variable.