I've implemented a simple GCM client and server. The client uses the current GCM client APIs (not the deprecated helper library). The server (C# & .NET) follows the corresponding server guidelines (using HTTP). My server runs on a machine within my company domain, so I'm connecting the client devices to a Wi-Fi access point inside the corporate network but with access to the Internet.
My problem in a nutshell is that notifications are received fine on 4.3+ handsets, but are never received on 4.1.2 handsets when connected to the corporate Wi-Fi network. If I connect a 4.1.2 device to our public guest Wi-Fi network the GCM messages are received as expected, but then the app can't connect to the corporate server.
I've seen some indications that GCM can fail when corporate networks have overly protective firewalls (e.g. here). But if it was just a firewall issue, surely the 4.3+ devices wouldn't receive any messages either?
Some additional details
My test handsets are as follows:
- Asus Nexus 7 (4.4.2)
- Samsung Galaxy S4 (4.4.2)
- HTC One (4.3)
- Samsung Galaxy S3 (4.1.2)
- Motorola Razr HD (4.1.2)
The server has received valid registration IDs from all five devices. On a 15-second timer it sends out a single message addressed to all five registration IDS. The response always shows that 5 messages were sent with no errors and no changed registration IDs. However, it is always received on the first three devices listed above, and never on the last two (running 4.1.2). When I debug them, the broadcast receiver isn't getting invoked at all.
I've also verified that all five devices:
- have Google Play Services 4.3.25
- have no SIM, hence no cellular data, and are on the same WiFi network
- have the correct date & time
- are registered with the same Gmail test account
- are running the same version of my client app
- have all sync settings for their Google account enabled
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…