What is multicast_id in GCM response?

2019-07-04 03:57发布

问题:

Example scenario:

I'm sending message to several devices using GCM. The response contains "multicast_id"? How can I use this value?

Thanks.

回答1:

It's just an identifier.

multicast_id Unique ID (number) identifying the multicast message.

There is no use for that ID, unless you wish to save it in your DB as a kind of "receipt" from Google, but the individual message_ids returned for each message that wasn't rejected by Google are much better as a receipt (since they indicate Google actually accepted your message and will try to deliver it).