Q: Why my device doesn’t receive notifications at all?
A: If your device is connected to the Internet via WiFi, and messages don’t get through to the device, please make sure that GCM/APNs ports are not blocked by your firewall.
For Android: The device accesses the GCM servers on ports 5228-5230. If your organization has a firewall that restricts the traffic to or from the Internet, you’ll need to configure it to allow connectivity with GCM. 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. It changes IPs frequently.
For iOS: Push providers, iOS devices, and Mac computers are often behind firewalls. To send notifications, you will need to allow inbound and outbound TCP packets over port 2195. Devices and computers connecting to the push service over Wi-Fi will need to allow inbound and outbound TCP packets over port 5223. The IP address range for the push service is subject to change; the expectation is that providers will connect by hostname rather than IP address. The push service uses a load balancing scheme that yields a different IP address for the same hostname. However, the entire 126.96.36.199/8 address block is assigned to Apple, so you can specify that range in your firewall rules.