GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

Notifications get "stuck", turning Cloud Messaging on/off solves the problem

Open VitalogyRS opened this issue 3 years ago • 63 comments

Hello,

I have a Huawei P40Pro, standard ROM, right now EMUI 12.0.0 with latest updates (based on android 10).

As everyone else with a relatively new Huawei, notifications are complicated but microg works very well. But sometimes, notifications are "stuck" and don't arrive (either teams, whatspp) although the Cloud Messaging service shows connected. If I toggle off / on the option "Receive push notifications" under Cloud Messaging then the notifications appear all at once and keep working for a while.

When the notifications are in this status, even if I enter the app in question I don't receive the notifications but can see the badge in the app.

I can't really understand if something triggers this behaviour, anyone else seeing this?

I'm on the latest microg.

Thank you

VitalogyRS avatar Feb 13 '22 19:02 VitalogyRS

The problem here is that Huawei's power management system sometimes kills mcroG service (even if you enable "Battery optmization ignored"). You can check this in: Settings -> Battery-> App launch -> 3/4 dots menu -> Launch records. Here you can see that sometimes microG services core is restricted from auto-start:

image

The solution would be to manually allow microG autostart and work in background, but I cannot find it in "App launch" apps list:

image

serrj-sv avatar Feb 14 '22 13:02 serrj-sv

Hi, I have a P40 lite and with latest version 0.0.24.214816 this as improved, and to me only happens during the night. I also disable WIFI and mobile data during this period. In the morning activating Wifi and mobile data doesn't re-enable microG Cloud Messaging, so turning it off and on solves the problem during the day.

mafs77 avatar Feb 14 '22 14:02 mafs77

The problem here is that Huawei's power management system sometimes kills mcroG service (even if you enable "Battery optmization ignored"). You can check this in: Settings -> Battery-> App launch -> 3/4 dots menu -> Launch records. Here you can see that sometimes microG services core is restricted from auto-start:

image

The solution would be to manually allow microG autostart and work in background, but I cannot find it in "App launch" apps list:

image

First, thanks for your reply.

Second, sorry, I should have been more clear on the configurations I have and should have said that all the optimizations are in place: AppLaunch v2 BatteryOptimizationv2

I've read all the forums and followed basically every suggestion I've seen but still this behaviour persists.

Thank you

VitalogyRS avatar Feb 14 '22 16:02 VitalogyRS

Hello,

Got a chance to make a video showing what I mean (sorry for the blur, but the bold characters will help). So it begins by me entering Teams and you will notice bold characters, meaning I have unread messages. After that I close all apps, go to MicroG, Cloud Messaging and toggle off / on the option "Receive push notifications". And you'll notice a Teams notification appearing.

Thank you

https://user-images.githubusercontent.com/99566144/154044982-95b9f0d2-c75e-4817-bdd3-26cad40ceb09.mp4

VitalogyRS avatar Feb 15 '22 10:02 VitalogyRS

Hello,

Got a chance to make a video showing what I mean (sorry for the blur, but the bold characters will help). So it begins by me entering Teams and you will notice bold characters, meaning I have unread messages. After that I close all apps, go to MicroG, Cloud Messaging and toggle off / on the option "Receive push notifications". And you'll notice a Teams notification appearing.

Thank you Example.mp4

Hello, I understand perfectly. I have/had that problem also, less now with the newer version. Check something please, open microG, Self-Check, "Permissions Granted" and "System". Do you have all boxes checked? Screenshot_20220215_110549

mafs77 avatar Feb 15 '22 11:02 mafs77

Iup, all options ticket (with the exception of the ones the official Huawei ROM doesn't support): Options

VitalogyRS avatar Feb 15 '22 13:02 VitalogyRS

@VitalogyRS try also reduce ping interval for push notifications: Cloud Messaging -> 3 dots -> Advanced -> change for all networks from default 5 min to 2 mins. then also try 60 sec if not helping. Note that it will likely affect battery.

serrj-sv avatar Feb 15 '22 13:02 serrj-sv

@serrj-sv, already did, the video is with the settings at 60 seconds both on wifi and mobile

Thank you

VitalogyRS avatar Feb 15 '22 13:02 VitalogyRS

@VitalogyRS try also builds from here: https://github.com/jcchikikomori/GmsCoreHuawei this is microG fork optimized for Huawei phones with extra functionality (maps v2 api, nearby share)

serrj-sv avatar Feb 15 '22 13:02 serrj-sv

@VitalogyRS try also builds from here: https://github.com/jcchikikomori/GmsCoreHuawei

I would try it but I can't seem to find the download section

VitalogyRS avatar Feb 15 '22 14:02 VitalogyRS

@VitalogyRS try also builds from here: https://github.com/jcchikikomori/GmsCoreHuawei

I would try it but I can't seem to find the download section

under "assets": https://github.com/jcchikikomori/GmsCoreHuawei/releases

serrj-sv avatar Feb 15 '22 14:02 serrj-sv

@serrj-sv, thanks!

One question, I have to uninstall microg and all it's components, or just gmscore, do you know?

VitalogyRS avatar Feb 15 '22 14:02 VitalogyRS

just gmscore

👆

serrj-sv avatar Feb 15 '22 14:02 serrj-sv

I'll give it a try also.

mafs77 avatar Feb 15 '22 14:02 mafs77

Ok, trying it. Let's see how it goes. 🤞

VitalogyRS avatar Feb 15 '22 14:02 VitalogyRS

Ok, trying it. Let's see how it goes. 🤞

Well, the notifications still don't show even if I toggle the Receive push notifications option off / on. Guess I'll go back to microg

VitalogyRS avatar Feb 16 '22 09:02 VitalogyRS

So... Went back to microg, latest version, and noticed that I was having the exact same problem as I did with GmsCoreHuawei, that is if I toggled the Receive push notifications option off / on the notifications didn't appear. Then I remembered: I read somewhere that earlier version of GmsCore were working better than the latest ones and my original posts were not with the latest version, was using v0.2.22.212658 at the time. I then read on the release notes of the next release (v0.2.23.214816) the following: Improve reconnecting logic

I'll test a bit longer with version v0.2.22.212658 to check if toggling the Receive push notifications option off / on does show the notifications and after I'm sure it does will upgrade to the next release, v0.2.23.214816, to try and figure out if something introduced on that release is the cause for the notification not being shown even when toggling the Receive push notifications option off / on

Thank you

VitalogyRS avatar Feb 16 '22 21:02 VitalogyRS

@VitalogyRS

Then I remembered: I read somewhere that earlier version of GmsCore were working better than the latest ones and my original posts were not with the latest version, was using v0.2.22.212658 at the time.

Most of the times it is just an impression, the latest version (which is v0.2.24.214816 and not v0.2.23.214816) should work better for notifications.

ale5000-git avatar Feb 17 '22 12:02 ale5000-git

@serrj-sv

@VitalogyRS try also builds from here: https://github.com/jcchikikomori/GmsCoreHuawei this is microG fork optimized for Huawei phones with extra functionality (maps v2 api, nearby share)

It isn't true, the only change that I know of (if I'm not wrong) is to fake device info that is now included also in offical microG. maps v2 api and nearby share are the same of offical microG.

ale5000-git avatar Feb 17 '22 13:02 ale5000-git

@ale5000-git

Most of the times it is just an impression, the latest version (which is v0.2.24.214816 and not v0.2.23.214816) should work better for notifications.

That's what I'm testing, if it's just an impression. But I did notice what I mentioned, the latest build won't show missed notifications when toggling off/on the Receive push notifications option and this one did.

And I realize the latest build is v0.2.24.214816 but if my tests prove correct, moving to the next release v0.2.23.214816 instead of v0.2.24.214816 will allow me to understand in which version whatever I'm noticing was introduced.

Thank you

VitalogyRS avatar Feb 17 '22 13:02 VitalogyRS

Hello everyone,

I can now confirm without any doubt that the v0.2.22.212658 version does behave as I mentioned, if by any chance a notification is missed, toggling off/on the Receive push notifications option shows the missed notifications. But in general the notifications work OK, sometimes are not immediate but do appear. Will upgrade to v0.2.23.214816 (not the latest release) and see if in that one the behaviour is the same. But this version (v0.2.22.212658) works very well on a Huawei P40Pro without GMS. Will update with the results of version v0.2.23.214816

Thank you

VitalogyRS avatar Feb 18 '22 15:02 VitalogyRS

Hello everyone,

Just happened a test case scenario, received a Teams message on my laptop but not on my phone. Toggling off/on the Receive push notifications option shows the missed notifications using version v0.2.23.214816. Will test a bit more and post the results.

Thank you

VitalogyRS avatar Feb 20 '22 17:02 VitalogyRS

Note that the difference of 0.2.23 vs 0.2.24 regarding notifications is none.

ale5000-git avatar Feb 24 '22 14:02 ale5000-git

Thanks @ale5000-git for your comment

I haven't said anything in the last few days but it does feel that version v0.2.22.212658 had less "stuck notifications" than v0.2.23.214816. Im other words it feels like I'm missing more notifications in 0.2.23 than in 0.2.22.

Would like to go back to 0.2.22 to test again but there's no easy way to re-register all the apps besides reinstalling them, is there?

Thank you

VitalogyRS avatar Feb 24 '22 18:02 VitalogyRS

Hello,

I now wonder if I kinda missed the obvious: notifications may be failing because the status turns to disconnected and never connects again unless I toggle off / on the option to Receive push notifications

Screenshot_20220228_115103_com.google.android.gms.jpg

Would a log of the current status help?

Thank you

VitalogyRS avatar Feb 28 '22 11:02 VitalogyRS

Hello,

I now wonder if I kinda missed the obvious: notifications may be failing because the status turns to disconnected and never connects again unless I toggle off / on the option to Receive push notifications

Screenshot_20220228_115103_com.google.android.gms.jpg

Would a log of the current status help?

Thank you

Same happen to me. After some time status turns to disconnected, so i must go in settings again and turn ON/OFF cloud messaging, to be able to receive notfications again.. You don't even know when that will happen, you must check offten. Very frustrating..

On Huawei P Smart 2021, workaround is to uninstall "POWER GENIE".. I guess it's the same on P40. "POWER GENIE" kills "GMS CORE", and this is the reason you won't receive notifications after some time..

I tried that.. And it works..

But without "POWER GENIE" i noticed lag in scrolling.. System is unstable. Because Power Genie is not that only reduces battery consumption (by controling wake locks), it also effect CPU and other things, so it ensures that your phone usage is optimal..

Maybe developer could find some other way for GMS CORE to stay active in background? Uninstalling Power Genie is not solution for our Phones..

EDIT: If MicroG could restart cloud messaging, or press ON/OFF itself, lets say every 30min, problem would be solved.. Maybe some modified MicroG for our Phone?

mire777 avatar Mar 02 '22 14:03 mire777

Same happen to me. After some time status turns to disconnected, so i must go in settings again and turn ON/OFF cloud messaging, to be able to receive notfications again.. You don't even know when that will happen, you must check offten. Very frustrating..

On Huawei P Smart 2021, workaround is to uninstall "POWER GENIE".. I guess it's the same on P40. "POWER GENIE" kills "GMS CORE", and this is the reason you won't receive notifications after some time..

I tried that.. And it works..

But without "POWER GENIE" i noticed lag in scrolling.. System is unstable. Because Power Genie is not that only reduces battery consumption (by controling wake locks), it also effect CPU and other things, so it ensures that your phone usage is optimal..

Maybe developer could find some other way for GMS CORE to stay active in background? Uninstalling Power Genie is not solution for our Phones..

Hello,

I may be wrong but I believe the P40Pro doesn't have PowerGenie.

Something else is probably causing this, the status turns to disconnected and it takes a while to get connected again (I'm now trying version 0.2.21, with version 0.2.23 the status stayed disconnected for more than 12 hours before automatically reconnecting)

Can anyone tell me what may cause the disconnection of the service considering the phone is not restarted and always has internet, wether wifi or mobile?

Thank you

VitalogyRS avatar Mar 02 '22 14:03 VitalogyRS

I may be wrong but I believe the P40Pro doesn't have PowerGenie.

Yes you have Power Genie - https://forum.xda-developers.com/t/powergenie.4104505/

Power Genie is what stops GmsCore from running. But i said uninstalling that would make Huawei phone unstable..

mire777 avatar Mar 02 '22 14:03 mire777

Yes you have Power Genie - https://forum.xda-developers.com/t/powergenie.4104505/

Power Genie is what stops GmsCore from running. But i said uninstalling that would make Huawei phone unstable..

Thanks, don't know why I was under the impression P40Pro didn't have it.

VitalogyRS avatar Mar 02 '22 14:03 VitalogyRS

Yes you have Power Genie - https://forum.xda-developers.com/t/powergenie.4104505/ Power Genie is what stops GmsCore from running. But i said uninstalling that would make Huawei phone unstable..

Thanks, don't know why I was under the impression P40Pro didn't have it.

You could try to uninstall Power Genie, and see what will happen, if you notice some lag, you can enable it again.

Link: https://forum.xda-developers.com/t/remove-powergenie-to-allow-background-apps-to-receive-push-notifications.3890409/

mire777 avatar Mar 02 '22 14:03 mire777