How can I receive multiple notifications by using GCM without replacing the precedent one?

后端 未结 2 495
天命终不由人
天命终不由人 2021-02-18 17:57

I\'m working on a project which receive notification from GCM server.

I\'ve got the registration ID from GCM server and i send it to my server application which save it

2条回答
  •  感动是毒
    2021-02-18 18:30

    The collapse key is relevant only to messages that were sent to the GCM server but haven't reached the destination device yet (if more than one such message has the same collapse key, only one of them will be sent to the device when it becomes online).

    In your question you describe a different situation - the first message is received by the device and then the second message is received by the device and replaces the original message. That has nothing to do with GCM. It has to do with the way your application handles the received messages. For example, if your application code that receives the message displays is as a notification, it's up to you to decide whether a new message will override the existing notification or create a new notification.

提交回复
热议问题