0

I created an Android app that can receive push notifications. I've installed the app on two different phones and verified that both can receive GCM push notifications. This test was done in the United States.

The following week, one of the phones traveled to Asia. But push notification could not be received on the phone in Asia. It had internet access but could not receive push notification.

Does anyone know why? Does there need to be special configuration. Can network block GCM messages?

code
  • 5,294
  • 16
  • 62
  • 113
  • 1
    If the other person is connected to the corporate wifi etc, it may be the firewall preventing the message. Opening certain ports have helped few others previously. Check http://stackoverflow.com/a/18396889/1306419. Also check if the problem still persist when user is on "mobile data" and not wifi. – Shobhit Puri Jan 26 '16 at 01:06

3 Answers3

2

It must be blocked by the country. e.g. google is blocked in China.

Do other google services work on the device.

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
rupesh jain
  • 3,410
  • 1
  • 14
  • 22
0

If you tried your application in Asian phones, surly it will work. or else You can change your location by changing IMEI number based on the country.

Dev Tamil
  • 629
  • 1
  • 9
  • 25
0

In developing countries, some telecom networks / home routers will aggressively disconnect idle TCP connections to save resources, preventing your GCM/FCM notifications from arriving on time.

FCM uses a heartbeat mechanism to keep its connection alive, by sending a "keepalive" packet every X minutes to the FCM servers. However, the heartbeat intervals used by FCM do not take into account aggressive networks in developing countries which will terminate idle connections.

This makes GCM/FCM quite unreliable in such developing regions: https://eladnava.com/google-cloud-messaging-extremely-unreliable/

As per China, GCM/FCM are blocked entirely by the Great Firewall of China.

As a workaround, check out Pushy which uses a fine-tuned MQTT connection with a faster heartbeat interval to prevent the connection from being terminated, and is not blocked in China.

Full disclosure - I founded Pushy.

Elad Nava
  • 7,746
  • 2
  • 41
  • 61