FORUMS
Remove All Ads from XDA

Toubleshooting Guide for GCM Wake-up

1,355 posts
Thanks Meter: 6,927
 
Post Reply Email Thread
GCM wake-up is considered to be one of the most unreliable feature among the experimental features, thus still stuck as donation-only.
There're many factors behind a working GCM push, and trouble with either may lead to the failure of the whole expectation.

Let's discuss the common misunderstandings first.

Quote:

1. The GCM indicator in App Analyzer does not necessarily mean the app uses GCM for the very notification feature you are expecting.

The GCM indicator only means GCM-related code is in that app's package. But the app may use GCM only for some of its notifications, or only in some criterias, or even the worse, does not use at all. To find out the actual usage of GCM within an app, read the trouble shooting instructions below.

2. Not all notifications are backed by GCM push.

Most instant messaging apps and some social apps use hybrid implementation with GCM and persistent connection (in a background service) to deliver more reliable instant notification, than relying on GCM only. In this case, some of the notifications you have received may not even come from a GCM push.
Hiberated apps lose its background service and thus fall-back to a GCM-only solution, effectively reducing the reliability of notification. If you noticed obvious delay or loss of some notifications after greenifying, it's probably the case.

3. The latency of GCM is affected by many factors, most notably how your carrier restrict the persistent connection.

The foundation implementation of GCM itself is also a persistent connection to Google's server. That means if your devices failed to keep this persistent connection, the latency of GCM is out of control. Carriers all over the world do restrict persistent connection to preserve their limited capability of signalling resources (not the bandwidth), by dropping connections idle for a while. GCM use periodic heartbeat packets to keep the persistent connection, but the default interval of 28 minutes for mobile network is far beyond the connection dropping threshold of some carriers (varying from minutes to hours), causing the persistent connection to drop frequently. As a result, GCM push may delay in minutes, or even half an hour. There's also a few carriers in the world even block the connections to Google's server in most time(China for example), causing GCM totally out of work.

To reduce latency caused by carrier restriction on persistent connection, try "Push Notification Fixer".

Now if you believe your app failed to wake up by a GCM push, follow these instructions to find the cause:

1. Open and monitor the logcat (Android log system), either on a USB-connected computer, or on your device with tool app like CatLog.

2. Set the filter to only include keyword (or tag) "GCM".

3. Let's trigger an expected GCM push (by sending an instant message from another device or so). You will soon read a line like this in logcat upon the arrival of GCM push:
Code:
I/GCM﹕ GCM message com.joaomgcd.autoremote 0:1426418730738334%0#02db4288f9fd7ecd
This means Google Play services received the GCM message from Google's server and ready to deliver it to the corresponding app (indicated by the package name in the line, com.joaomgcd.autoremote in the example). If you cannot find this line in a reasonable time span, then it may be that app which lose the registion to GCM. Try logout and login your account, or clear the data of the app, or even uninstall and re-install it to restore its registration to GCM.

In all good situation, you should now receive the notification. If not, read on.

4. If the target app is hibernated before the arrive of GCM push and you have activated "GCM Wake-up" feature, then open Greenify ASAP (since it may hibernate again in a few minutes).

You will probably find that app is awake and listed in the "WILL HIBERNATE..." section. In this case, Greenify had managed to wake up the hibernated app and deliver the GCM message to it, but that app may failed to process it correctly and show a notification. This does happen to some apps which can't deal with GCM message upon wake-up. Try trigger another GCM push manually, if the notification shows up this time, that app falls into this category. It's hard to blame the developers for that, since they may not prepare for the arrival of GCM push when their background service is not running. So I'm still trying to figure out a better solution to make "GCM Wake-up" compatible with these apps.

5. If the app still stays hibernated, then the wake-up attempt might fail.

Back to the logcat, you probably read another line like this:
Code:
W/GCM-DMM﹕ broadcast intent callback: result=CANCELLED forIntent { act=com.google.android.c2dm.intent.RECEIVE pkg=com.joaomgcd.autoremote (has extras) }
It means the push is not delivered successfully. If you did activated "GCM Wake-up" but still read this line, then it may be Greenify's fault, except if you have disabled the notification of that app in system Settings - Apps - That App - Show notifications (unticked). Greenify checks this setting before trying to wake-up an app to deliver GCM push.

Note: As a reference, try "AutoRemoteLite" with its web interface to trigger GCM push.
The Following 15 Users Say Thank You to oasisfeng For This Useful Post: [ View ] Gift oasisfeng Ad-Free
 
 
15th March 2015, 01:53 PM |#2  
OP Senior Member
Thanks Meter: 6,927
 
More
Please report your finding in this thread with the detailed information:

Device model
ROM
Android version
Working mode of Greenify (Root or Boost)
Is "Deep Hibernation" also enabled.

and I'll try my best to help analyzing the issues.
16th March 2015, 12:15 PM |#3  
v7's Avatar
Retired Forum Moderator / Recognized Contributor
Arkham
Thanks Meter: 8,614
 
Donate to Me
More
Device:Xperia ZR C5502
ROM:CM12 UNOFFICIAL by @xenius9 Link:https://yadi.sk/d/dTadZHj_fCZKN
Greenify Donation Version 2.6 beta 6
Boost Mode
Deep Hibernation enabled.
Logs attached

Tapped from my furious ZR
Attached Files
File Type: txt 2015-03-16-17-54-42.txt - [Click for QR Code] (11.7 KB, 226 views)
The Following User Says Thank You to v7 For This Useful Post: [ View ] Gift v7 Ad-Free
16th March 2015, 01:22 PM |#4  
xda_emanuel's Avatar
Senior Member
Thanks Meter: 133
 
More
Just tried that app Catlog with facebook and facebook messenger which are the only 2 apps i've in hybernation except for google plus which i turned off notification. Sooo.... When those apps are not greenified the gcm stuff seems to be received property... I can see also the gcm received in the google play service stuff for the heartbeat. But when those apps are greenified i don't received nothing about facebook.. no gcm and no notification till i open again the app. Thats weird i think, its like the app is on a strong deep sleep also because when i tried to send a message in facebook from my another account with catlog open and the Word Gcm in the search option, seems that theres no gcm received from that app till obliviosly i open them. I don't know but i remember when i was on kitkat they work fine. Anyway my configuration is

Android 5.0.2
Nexus 4
Last beta 5
Rom : purity
Deep hibernation disabled
Boost mode with xposed alpha 2 and gcm notification enabled. and also keep notifications enabled.
16th March 2015, 04:29 PM |#5  
Senior Member
Thanks Meter: 2,300
 
More
Quote:
Originally Posted by xda_emanuel

Just tried that app Catlog with facebook and facebook messenger which are the only 2 apps i've in hybernation except for google plus which i turned off notification. Sooo.... When those apps are not greenified the gcm stuff seems to be received property... I can see also the gcm received in the google play service stuff for the heartbeat. But when those apps are greenified i don't received nothing about facebook.. no gcm and no notification till i open again the app. Thats weird i think, its like the app is on a strong deep sleep also because when i tried to send a message in facebook from my another account with catlog open and the Word Gcm in the search option, seems that theres no gcm received from that app till obliviosly i open them. I don't know but i remember when i was on kitkat they work fine. Anyway my configuration is

Android 5.0.2
Nexus 4
Last beta 5
Rom : purity
Deep hibernation disabled
Boost mode with xposed alpha 2 and gcm notification enabled. and also keep notifications enabled.

Facebook has changed something in the two apps recently. It used to be working fine. Now I just use facebook lite since it works well with greenify and gives me push notifications.
16th March 2015, 06:56 PM |#6  
xda_emanuel's Avatar
Senior Member
Thanks Meter: 133
 
More
Quote:
Originally Posted by davtse

Facebook has changed something in the two apps recently. It used to be working fine. Now I just use facebook lite since it works well with greenify and gives me push notifications.

Just installed facebook lite to try what u said.. Gcm still doesnt work if the app is greenifyed

EDIT
I found on a thread the messenger1.0.1 apk and with greenify now my push notifications are working fine.
18th March 2015, 10:16 AM |#7  
OP Senior Member
Thanks Meter: 6,927
 
More
GCM wake-up is expected to be improved in the latest beta 6 (being rolled out), with a new warm-up and re-delivery mechanism.

Test feedback is welcome~
18th March 2015, 10:22 AM |#8  
Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by xda_emanuel

Just installed facebook lite to try what u said.. Gcm still doesnt work if the app is greenifyed

EDIT
I found on a thread the messenger1.0.1 apk and with greenify now my push notifications are working fine.

It's as simple as that for me: When fb and messenger are not greenified, push notifications come through perfectly. When they are, gcm for both these applications does not work. So I do not have to check something with the use of this guide, because it's obvious that Greenify stops the notifications. Whatsapp works flawlessly for me, even when greenified.
It's also obvious for me that both these apps changed something in the past 3-4 versions (for fb) that broke the gcm when greenified. It worked in the past for me. But Greenify did not keep up
Greenify devs please fix that bug!
I'm on Sony SP, stock 4.3, rooted, boost mode (also tried rooted mode), greenify 2.5.2, messenger 23.0.0.20.13, fb 29.0.0.23.13
18th March 2015, 02:29 PM |#9  
K-a-M-u-Z-u's Avatar
Senior Member
Thanks Meter: 137
 
More
Quote:
Originally Posted by xda_emanuel

Just installed facebook lite to try what u said.. Gcm still doesnt work if the app is greenifyed

EDIT
I found on a thread the messenger1.0.1 apk and with greenify now my push notifications are working fine.

where can i get this messenger version?
18th March 2015, 11:05 PM |#10  
Account currently disabled
Thanks Meter: 32
 
More
is it kernel or rom related?
my whatsapp push gcm worked perfectly on my galaxy s4 (stock kernel)

now it doesnt work on my note 2 with agni kernel (i changed phone because of overheating problems)

could it be because i am on 4.4.4 (i had 4.4.2 on s4) or rom or kernel?
if i degreenifiy whatsapp can receive gcm push normally though.

any expert can help me?

thanks in advance
19th March 2015, 04:17 AM |#11  
v7's Avatar
Retired Forum Moderator / Recognized Contributor
Arkham
Thanks Meter: 8,614
 
Donate to Me
More
Quote:
Originally Posted by robert1337

my whatsapp push gcm worked perfectly on my galaxy s4 (stock kernel)

now it doesnt work on my note 2 with agni kernel (i changed phone because of overheating problems)

could it be because i am on 4.4.4 (i had 4.4.2 on s4) or rom or kernel?
if i degreenifiy whatsapp can receive gcm push normally though.

any expert can help me?

thanks in advance

Do you get notified for other apps?
If its a whatsapp only problem,clear data for whatsapp or reinstall it.That solved the issue for me.

Tapped from my furious ZR
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes