While my device has not internet connection, I am sending message from server to application with GCM. After that, when device connect the internet, i can\'t get the message. Is
you can get all the messages send to your device.
GCM server keeps account of your all messages send to your device. And it shows these in notification area whenever device get connected to Internet.
You are getting only one message because you are assigning same NOTIFICATION ID in notify() function of your code
your code probably using this :
// 0 is notification id
notificationManager.notify(0, notification);
change your NOTIFICATION ID everytime to get all messages in notification area.
Such As :
static int NOTIFICATION_ID = 0;
if (NOTIFICATION_ID > 1073741824) {
NOTIFICATION_ID = 0;
}
notificationManager.notify(NOTIFICATION_ID++, notification);
if clause keeps you safe from overflow of int value. You can ignore it according to your requirement.
I have already tested this scenario. Now its your turn.
Happy to Help !!