I need to send push notifications to thousands of users. But according to firebase documentation i can send only to 500 users at a time.
getMessaging().sendMulticast(message)
.then((response) => {
console.log(response.successCount + ' messages were sent successfully');
});
I can handle upto 1000 users using this method
const registrationTokens = [
'YOUR_REGISTRATION_TOKEN_1',
// ...
'YOUR_REGISTRATION_TOKEN_n'
];
getMessaging().sendToDevice(registrationTokens, payload)
.then((response) => {
console.log('Successfully sent message:', response);
})
.catch((error) => {
console.log('Error sending message:', error);
});
Is there any other method how i can handle many users (>10,000) at a time ? Does sending messaging to topics can solve this issue ? Or it has its limitations as well
const message = {
data: {
score: '850',
time: '2:45'
},
topic: "topic"
};
// Send a message to devices subscribed to the provided topic.
getMessaging().send(message)
.then((response) => {
console.log('Successfully sent message:', response);
})
.catch((error) => {
console.log('Error sending message:', error);
});