It seems that the fcm API allows sending to multiple tokens via sendToDevice and sendMulticast. sendToDevice is a legacy call? Should we use sendMulticast instead?
https://firebase.google.com/docs/reference/admin/node/admin.messaging.Messaging#sendtodevice https://firebase.google.com/docs/reference/admin/node/admin.messaging.Messaging#sendmulticast
"sendMulticast" returns Promise for BatchResponse whereas "sendToDevice" returns Promise for MessagingDevicesResponse
From https://firebase.google.com/docs/cloud-messaging/send-message#adminSDK-legacy-send-methods regarding "sendMulticast":
For Firebase Admin SDKs, this operation uses the sendAll() API under the hood, as shown in the examples. The return value is a BatchResponse whose responses list corresponds to the order of the input tokens. This is useful when you want to check which tokens resulted in errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With