GCM message is not received on broken network about 15-30 minute
This is because of Heartbeat issue with server you can forcefully send the heartbeat where you want
context.sendBroadcast(new Intent("com.google.android.intent.action.GTALK_HEARTBEAT"));
context.sendBroadcast(new Intent("com.google.android.intent.action.MCS_HEARTBEAT"));
OR
There's no need to send the heartbeat from the GCM server to the phone, you can force android itself to send the heartbeat sooner that it would otherwise do.
I had a look at the Push Notifications Fixer app, which I tested and worked for me, and it seems all you need to do is broadcast the following intents:
com.google.android.intent.action.MCS_HEARTBEAT
com.google.android.intent.action.GTALK_HEARTBEAT
Android GCM - Handling received messages
There seems to a delay ... a BIG delay between the time that the message was sent from the server to GCM, and when the message was received in the app.
I restarted the phone and before it connecting to the my wifi network, I received all the messages.
There seems to be no delay if I'm on a 4G (and probably with 3G is the same).
Googling information about this delay, it seems that it is more common than it should be:
- How to avoid delay in Android GCM messages
- Receive Android GCM messages so slow?
- Google Cloud Messaging - messages either received instantly or with long delay
I tried the workaround presented in the first link, but while I'm on wifi, I receive a few messages right away, but after a while it stops.
When I switch to 4G, I start receiving them again.
I observed this also happening with WhatApp
notifications, because while testing this push notifications over wifi or 4G, I observed that when I switched to 4G I started receiving notification from the app, from 2 hours ago.
Also, according to link#3, the message should be received with a maximum delay of a few minutes, so it may also be a problem with the device, in this case a Nexus 5.
I may update this answer as I discover more about this issue.
Related Topics
Difference Between Extending Lifecycleactivity,Activity,Actionbaractivity & Appcompactactivity
How to Perform a Fade Animation on Activity Transition
Logcat Not Displaying My Log Calls
What Should Be the Package Name of Android App
Android Taking Screenshot of Offscreen Page
Why Ondraw Is Not Called After Invalidate()
Calling Startintentsenderforresult from Fragment (Android Billing V3)
Android Upload Video to Remote Server Using Http Multipart Form Data
Using Tesseract for Handwriting Recognition
Autocompletetextview Not Completing Words Inside Parentheses
Android Java - Joda Date Is Slow
Asynctask: Where Does the Return Value of Doinbackground() Go
How to Use the Android Accelerometer
Android Progressbar UI Custom Layout
Fragment Already Added Illegalstateexception
How to Set the Output Image Use Com.Android.Camera.Action.Crop