Force connection reestablishment from client app to GCM <p>We are using GCM for messaging from server to the client app. It is a standard implementation where installation of the client app talks to the gcm server to get the reg id, sends it to our server and our server uses that reg id to push messages to the app. Our requirement is that these push notifications should be instantaneous and as real time as possible.</p> <p>But the connection between GCM and the client app seems to disappear after a few minutes of inactivity. We have tried several things on our end: 1. Using an alarm manager to keep running a heartbeat intent that sends heartbeats to gcm. This does not work on custom android OSes where cleaning memory forces close of all app alarms. 2. Sending an upstream message from client to gcm in the hope that it establishes connection. 3. Using high priority messages from server to gcm hoping that would force a connection between gcm and app.</p> <p>None of it has worked so far. Any idea if there's an API in the play services framework on the client side to force establish a connection to gcm if the app determines there is no current connection based on not getting an ACK for an upstream message?</p> <p>Some research we did: 1. <a href="https://productforums.google.com/forum/#!msg/nexus/fslYqYrULto/lU2D3Qe1mugJ" rel="nofollow">https://productforums.google.com/forum/#!msg/nexus/fslYqYrULto/lU2D3Qe1mugJ</a></p> <ol start="2"> <li><a href="http://stackoverflow.com/questions/18250188/do-gcm-ccs-upstream-messages-force-a-re-connection-to-the-gcm-network">Do GCM CCS Upstream Messages force a re-connection to the GCM network?</a></li> </ol>