microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.27k stars 1.7k forks source link

Google Cloud Messaging doesn't work properly in LineageOS for microG 15.1 (on OnePlus 3T) #502

Closed deesnook closed 5 years ago

deesnook commented 6 years ago

I've flashed the latest version and it looks like registering for GCM doesn't always work. Some apps have sucessfully registered, others haven't. Consequently, push notifications do not work in the latter cases

Any ideas?

maxammann commented 6 years ago

Same here, Telegram and Whatsapp in my case

jcgruenhage commented 6 years ago

Same here, OP3 (non-T). For some reason the banking app I use needs GCM 🙄

Generator commented 6 years ago

This is a duplicate of #439

I've manage to register Whatsapp with microG GCM using an older build (2.17.351), some newer builds fail to register with microG, probably the same applies to other apps

PS: For Telegram users you can use the Telegram from F-Droid, don't need GCM

javeq1 commented 6 years ago

I have the same problem with an app we use at my work place. It used to register correctly with Android 7 (Lineage OS 14) but the same version of the app does not register itself now in android 8.1 (Lineage OS 15).

drrossum commented 6 years ago

@Generator Do you get push notifications once registered? I did try this some weeks ago, registered to GCM using an old WhatsApp version by changing the system clock and then updated to a newer version that had not yet expired. I never got push notifications for WhatsApp. The GCM status in the microG app still shows "no messages received so far" for WhatsApp after a couple of weeks.

edit: I can confirm, just tested this on LineageOs 15.1, that WhatsApp 2.17.351 receives microG's GCM push notifications. It's sad that this version expires 2018-05-18.

Generator commented 6 years ago

@drrossum changing the system clock didn't work here, WhatsApp still notifies to update the app and didn't register GCM, WhatsApp 2.17.351 was the older version that i could install and register GCM, however with newer versions 2.17.351 wont work anymore if you want to install and register GCM, will be a newer version, til the newer versions wont register anymore if the bug isn't fixed.

Still have some apps that couldn't register GCM, and i'm experience some battery drain, cant tell if is related with microG or not, that didn't happen with Android 7.1.2

Tested with: Android: 8.1.0 WhatsApp: 2.17.351 microG: 2.4.108 (from NanoDroid)

screenshot_microg_services_core_20180326-160705

drrossum commented 6 years ago

This is what I do, on Lineage 15.1 (8.1)

I'm now trying WA 2.17.395, the next stable version that has not yet expired. It looks like it doesn't register but does receive push notifications if WA was registered with v2.17.351. I need to test this more, though.

conrad-heimbold commented 6 years ago

logcat?

Generator commented 6 years ago

Came across this workaround

Disable battery optimization (doze) for WhatsApp and you should receive messages without delays

Source: XDA microG thread

Didn't test it, but can probably work

drrossum commented 6 years ago

That should work at the cost of increased battery consumption

Tom4tot commented 6 years ago

So I tried this workaround from @drrossum : https://github.com/microg/android_packages_apps_GmsCore/issues/502#issuecomment-376210921

And it doesn't work for me, see this post: https://forum.xda-developers.com/showpost.php?p=76340601&postcount=849

As this solution "Disable battery optimization (doze) for WhatsApp and you should receive messages without delays": it's not satisfying either from my experience.

drrossum commented 6 years ago

It doesn't work for me either anymore. My apps were still registered in GCM but did not receive push notifications anymore. The workaround that had still worked for me on march 26 no longer worked only a week or so after that date.

1337sup3rh4x0r commented 6 years ago

I can confirm the same behavior on my OnePlus 2 using microG LineageOS 15.1 latest weekly build.

Some apps seem to receive notifications sporadically (in my case e.g. signal).

Other apps register fine and are shown in the Google Cloud Messaging List of microG Settings, but never receive any message.

One app (Threema in my case) doesn't even register and doesn't show up in the list.

Is there any specific info we can supply to help understanding the root cause here?

Vikingtons commented 6 years ago

Could it have something to do with this:

https://developers.google.com/cloud-messaging/faq

Perhaps the move the FCM has interfered with GMSCore functionality? At the very least, could this explain why some push notification applications work as intended, whereas others don't?

ale5000-git commented 6 years ago

We shouldn't mix 2 different problems: 1) The switch to FCM that cause problems 2) The delayed messages caused by Doze

The first need FCM support in microG while the second is the one discussed on #338

tobiasKaminsky commented 6 years ago

We are using


implementation "com.google.firebase:firebase-messaging:12.0.1"
implementation "com.google.android.gms:play-services-gcm:12.0.1"

and our app/device is not registered for push notifications at all.
Downgrading this to 9.6.x is resolving the problem, without any further code changes.

Maybe some other can test this and if this workaround works, I hope it will help the microG dev to find a solution for newer version.
timea-techgirl commented 5 years ago

Possible workaround: https://github.com/microg/android_packages_apps_GmsCore/issues/631#issuecomment-429013399

ale5000-git commented 5 years ago

The problem should be fixed in the new version of microG GmsCore released yesterday, I'm closing this for now. Please try it and report back.