Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
deesnook opened this issue Mar 12, 2018 · 18 comments

Comments

@deesnook
Copy link

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
Copy link

Same here, Telegram and Whatsapp in my case

@jcgruenhage
Copy link

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

@Generator
Copy link

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
Copy link

javeq1 commented Mar 25, 2018

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
Copy link

drrossum commented Mar 26, 2018

@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
Copy link

Generator commented Mar 26, 2018

@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
Copy link

drrossum commented Mar 26, 2018

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

  • backup WA chat
  • uninstall WA
  • set system clock back in time (before 2018-03-18)
  • install WA v2.17.351, do not run WA yet!
  • open WA app settings and enable all permissions
  • now run WA and register the user account
  • restore chat backup
    WA should now register with microG GCM and be able to receive GCM push messages.
    If you reset the system clock and WA cries that it has expired, you can do the following:
  • change system clock back to before 2018-03-18
  • adb install -r whatsapp_2.17.351.apk
  • run WA

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
Copy link

logcat?

@Generator
Copy link

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
Copy link

That should work at the cost of increased battery consumption

@Tom4tot
Copy link

Tom4tot commented Apr 25, 2018

So I tried this workaround from @drrossum : #502 (comment)

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
Copy link

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
Copy link

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
Copy link

Vikingtons commented May 15, 2018

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
Copy link
Member

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
Copy link

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
Copy link

Possible workaround:
#631 (comment)

@ale5000-git
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests