pokoso
pokoso

Reputation: 1057

GCM message is not received on broken network about 15-30 minute

  1. connect my Android device to WIFI AP.
  2. remove WLAN cable from AP, and connect it again.
  3. Trying send a GCM message to my device, but message's not arrived.
  4. after 15-30 min, GCM message's arrived.

I think GCM service is trying to send a refresh message to server in 15-30 min every time. so during this time, GCM service on broken network, cannot recv any GCM message from server until connection has been restored.

and I've tested this issue on FCM, but result's same.

on iOS (I mean APNS), it's working fine at same situation.

Is there any good solution to make this delay to sort on Android device?

Upvotes: 2

Views: 284

Answers (1)

Arslan Javed
Arslan Javed

Reputation: 83

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

Upvotes: 1

Related Questions