Do GCM CCS Upstream Messages force a re-connection

2020-03-26 03:35发布

问题:

I am having some issues with GCM push notifications not arriving properly on Android devices. After days of research I found out, that Android Devices use a heartbeat to keep the connection to the GCM services. Sadly, the heartbeat seems to be way too high and thus the Android device can (but not always does) lose connection to the GCM services (e.g. when switching from WLAN to 3G).

There has been a lot of discussion about this problem on Google's product forums, but there doesn't seem to exist a real solution other than using a third party push service like parse.com

Now Google has announced the GCM Cloud Connection Server, which enables Apps on Android devices to send upstream messages through GCM to a third party app server.

Does anyone know if the usage of upstream messages forces a re-connection to the GCM network when the connection is not available?

回答1:

I tested this and it doesn't seem so. But you can force Android to send a regular notifications heartbeat by sending the following broadcast intents:

com.google.android.intent.action.MCS_HEARTBEAT
com.google.android.intent.action.GTALK_HEARTBEAT

I got this from the Push Notification Fixer app on Google Play (I'm not the developer). https://play.google.com/store/apps/details?id=com.andqlimax.pushfixer.noroot



回答2:

You can read the full description of the problem here:

https://productforums.google.com/forum/#!msg/nexus/fslYqYrULto/lU2D3Qe1mugJ

In few words, the problem is the tcp idle timeout caused by some routers or mobile carriers.