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

android, c#, google-cloud-messaging, push-notification, web-services

Solution

You need to make sure that the value of the 'collapse_key' field in each message is different

Problem

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 in the database. My device receive the message but when I try to send another one, the precedent is replaced. I know that we've 2 types of message: - Collapsible "send to sync" - Non-Collapsible So without changing the name of the message, how can I get two message send at different time? UPDATE 1: When my device is offline (for example airport mode activated), I try to send for example 2 messages from my application server to Google server (I read that Google stores all the messages). But when I desactivate this mode, I receive only the last message sent. I use different collapse_key for different message and I receive all of them (of course when the device online). Is anybody knows how can I fix this?

Original source