问题
I am aware that I can supply registration_ids
to the JSON request to send to multiple devices in the form of string arrays. However, I have a unique token that I want to send to each of those registration_ids
. How can I achieve that without simply looping the send request for the number of devices I wish to send to:
registration_ids: [1,2,3,4,5]
data: {
//if id==1, include the necessary token I wish to include.
}
回答1:
Unfortunately, if you are attempting to send something unique to each user, you'll have to send each unique payload separately.
What I can think of (just assuming a scenario) is for you to send a specific parameter (an ID of some sort) and have the client app interpret it depending on the user. Hope that makes sense.
来源:https://stackoverflow.com/questions/41755955/c-sharp-send-notification-to-device-group-with-unique-custom-data-fcm