Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Messaging (GCM) not delivering when device is back online

I am developing Android app using GCM. Currently I am using standard Google libs on client and server sides. If I am testing on two Android devices GCM works fine when both devices switched on regardless if my app is running or not.

However if Device A is switched off and I am sending messages to it from Device B, when Device A switched back on it doesn't receive any messages been sent while it was off line.

On server side (which initiates an actual send) every message to Device A has no collapse_key, time_to_live is set to 2000000 (just in case for testing purposes). Actual send has retries parameter set to 50 (in case GCM itself is unreachable, however this is unlikely).

Do I need to complete the GCM registration procedure on device boot? Currently I do so.

Please note that GCM broadcast receiver and GCMIntentService were set as well as permissions in manifest as described on Google web site.

Any advice will be much appreciated. I really got stuck with this issue.

like image 844
user986589 Avatar asked Oct 15 '12 19:10

user986589


People also ask

What is GCM push notification?

Google Cloud Messaging (GCM) was a mobile notification service developed by Google that enables third-party application developers to send notification data or information from developer-run servers to applications that target the Google Android Operating System, as well as applications or extensions developed for the ...

What is FCM GCM?

Firebase Cloud Messaging (FCM), formerly known as Google Cloud Messaging (GCM), is a cross-platform cloud solution for messages and notifications for Android, iOS, and web applications, which as of June 2022 can be used at no cost.

How does Google Cloud Messaging work?

The first step in GCM is that a third-party server (such as an email server) sends a request to Google's GCM server. This server then sends the message to your device, through that open connection. The Android system looks at the message to determine which app it's for, and starts that app.


1 Answers

Sorry guys. It was my fault. Shared preferences were not loaded properly, that caused GCMIntentService to operate unproperly. Messages go in fine.

So SOLVED

like image 103
user986589 Avatar answered Nov 10 '22 20:11

user986589