How to Avoid Delay in Android Gcm Messages/Change Heartbeat

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:

  1. How to avoid delay in Android GCM messages
  2. Receive Android GCM messages so slow?
  3. 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



Leave a reply



Submit