0

I'm testing android's GCM demo application. The first step in GCM is to register the device with GCM server i.e. sending Device Id and get Registration key. But I'm testing on a network which has firewall. Now I have allowed the connection through firewall for specific staic ip that is device's ip. But how do I ensure that firewall is not creating any problem. Is there any url or any way by which I can test that GCM server is accessible.

Currently I'm getting this error. From GCM:recoverable error (SERVICE_NOT_AVAILABLE).

Falcon165o
  • 2,875
  • 1
  • 20
  • 31
Chimu
  • 758
  • 1
  • 6
  • 16
  • This is probably a duplicate of [this question](http://stackoverflow.com/questions/15571576/which-port-and-protocol-does-google-cloud-messaging-gcm-use/15572664#15572664). You need to open the relevant ports. This is relevant only if your device is using a WiFi connection. – Eran Jun 07 '13 at 17:14

1 Answers1

0

I would start by restarting the phone (fixed multiple problems when I ran into this problem). I would also verify time/date is correct on the phone roughly. Be careful when looking at some GCM code online as a lot of the code contains deprecated functions.

After that, I would implement retry logic as shown below on my 3G/4G Scenario.

If you are on 3G/4G:

Errors in the 500-599 range (such as 500 or 503) indicate that there was an internal error in the GCM server while trying to process the request, or that the server is temporarily unavailable (for example, because of timeouts). Sender must retry later, honoring any Retry-After header included in the response. Application servers must implement exponential back-off. Troubleshoot

If you are on Wi-Fi:

Note: If your organization has a firewall that restricts the traffic to or from the Internet, you need to configure it to allow connectivity with GCM in order for your Android devices to receive messages. The ports to open are: 5228, 5229, and 5230. GCM typically only uses 5228, but it sometimes uses 5229 and 5230. GCM doesn't provide specific IPs, so you should allow your firewall to accept outgoing connections to all IP addresses contained in the IP blocks listed in Google's ASN of 15169.

Falcon165o
  • 2,875
  • 1
  • 20
  • 31