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.
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 ...
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.
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.
Sorry guys. It was my fault. Shared preferences were not loaded properly, that caused GCMIntentService to operate unproperly. Messages go in fine.
So SOLVED
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With