Gmscore: GCM -> FCM Update needed for push messaging [$623 PAID] [$623 awarded]

Created on 14 Nov 2017  ·  70Comments  ·  Source: microg/GmsCore

---- EDITED 26. August for summarizing the history of original issue and needed solution

Google has updated the push messaging infrastructure to FCM and will retire the old setup called GCM in 2019 (https://firebase.googleblog.com/2018/04/time-to-upgrade-from-gcm-to-fcm.html).

Hence apps are moving over to use FCM and stop working with current GCM features of microg. This results in different app behaviors. Some apps do not receive any push messages anymore, others (like Whatsapp) fall back to a polling mechanism, that uses lots of battery.

To use updated apps again with microg, the GCM functionalities mimicking google service framework will need to be updated to FCM.

---- Original Issue that lead to missing FCM functionality issue
Hi there,

I have a strange behaviour on my phone with GCM on AOSP Oreo. Some apps can register for GCM, even push notification tester works flawless. However Whatsapp and Threema won't register for the service.
I regularly get the message "GmsGcmRegisterSvc(6107): registration not allowed".

So far I have the feeling, that the "ask for new apps" function is not working properly. As it was enabled in the beginning (When installing Threema and Whatsapp the first time), but not anymore.

Is there a way to clear the list of registered apps and start over? This is just a hunch now and want to test this, before digging into other things.

Regards
Chris

P.S.: If you have any other idea, let me know. Can also produce some logfiles.

Bountysource

bounty ☁️ Cloud / Push Messaging

Most helpful comment

There seems to be an issue with automatic device registration in latest version. If you have similar issues as described by @Mafus1, open the system phone app and dial *#*#2432546#*#* to do a manual device registration.

All 70 comments

So I wiped the phone and did a complete reinstall. Same behaviour as before. Apps can register, push notificaton tester and other apps work.
However Whatsapp or Threema still do not show up in the registration list and do not receive messages via GCM. Within Threema I can reask the registration with GCM, however it receives a timeout.

Any idea? Any logs needed?

WhatsAPP won't register at my side.

So I checked with an older version (~mid 2017) of Whatsapp (2.17.223) and that will register fine with GCM.

So it seems that something has changed in the last versions and will need some adaptation in GMS Core.

I don’t know a lot of things about this, but maybe they moved to FCM instead of GCM.

I updated WhatsAPP and since the last update, it registered fine.
Maybe, it was because TitaniumBackup Restoration or was there a bug in a previous WhatsAPP version?

Restoring an app with TitaniumBackup is known to break its GCM, unless the app is capable of re-registering itself. The app's GCM connection may still work though if everything has taken place within the same Android installation, but if it is a different one or a different ROM, then it will always break (as the old token is no longer valid).

Not sure about FCM. I am not a developer, but it is at the core GCM. They will have changed it, but can't tell to what extend.

I do not use TitaniumBackup Restore and have this phenomenon also with Threema.
So far left options are: bug in app or needed adaptation in microg.
Will check if older version of Threema solves this as well, then it should be needed adaptation in microg. (As I can't imagine Threema and Whatsapp to share code)

I guess the issue gets more pressing now, as e.g. Whatsapp does not allow you to install older versions. It forces you to update before registration.

Hence the question: Is microg dead? I haven't seen updates aside from the google service number for a year now and more and more things are getting unusable.

I know about open source developers and "don't bother them, as they are doing it in their free time". But I am not asking to finish this at a certain time, more for a clear status on who is actually still developing this or if no one finds time?

I'd like to ask that question, too. I'm grateful as for several years MicroG has allowed me to be almost Google-free, but I just now try to setup a new smartphone, and I do not longer get MicroG to work. As there is not too much activity on GitHub, it would be great to know if there is a fix in work or if it's time to switch back to Google :-(. As chris42 says, all the usual caveats concerning oss developpers apply ;-).

I changed the Title to something more meaningful and added a $150 Bounty on Bountysource.

After numerous other issues referenced and talks about it in the forum. What is essentially needed to fix this issue:
Rework of GMSCore to update GCM push messaging to FCM. I would consider it solved by the following:
Current functionalities re-enabled

  • Registering apps in Microg with current functionality of whitelist should work again
  • Message counter as usual, to verify, that messaging is working
  • Push messages are delivered on time and reliable
  • Message notification is working as usual

I don't think keeping backwards compatibility makes sense, as GCM is to be deactivated. Not sure if a transfer to FCM is feasible for old GCM (not updated) apps?

If I'm not wrong FCM is just an extension of GCM (I'm not sure) so backwards compatibility is implied.

Yes and No. FCM apparently has a lot of GCM in its core, however the GCM API and servers will be deprecated in April 2019.
See here https://firebase.googleblog.com/2018/04/time-to-upgrade-from-gcm-to-fcm.html

Nice idea with the bounty starting for fixing this problem.
I will add some bucks too, after the holidays.

Note that client SDKs and GCM tokens will continue to work indefinitely. However, you won't be able to target the latest version of Google Play Services in your Android app unless you migrate to FCM.
(https://developers.google.com/cloud-messaging/faq)

So, basically, microG has to reimplement its push messaging system to use Firebase servers and to add a client-side Firebase API alongside the existing GCM one, so both old and new apps can still work.

@dos1
Yes pretty much. The GCM part could also be put into an extra proxy app. I think this was done with c2dm as well, when GCM was introduced.
The developer would need to see if this is possible and worth to put effort in. First focus should be to adapt FCM API and handling of FCM Servers as this is missing for a lot of people.

Stupid question: Who is the said developper? What's the matter with Marvin? I reverted to GApps because MicroG would no longer work properly, but I eagerly watch the developments here.

This project is very promising. Thanks to all the backers and developers for this. I'll eagerly be watching the developments, too!

anyone already started working on it?

@Larx
"The developer" is any developer interested to fix it. Payment is done via bountysource.

@kwokkeunglam
"denim2x" just set a bounty goal on bountysource (https://www.bountysource.com/issues/51518216-gcm-fcm-update-needed-for-push-messaging). This does not necessarily mean he started, but apparently he is interested.

Happy to help anyone who is looking into this.

I prefer a new way of push, just teach developers to use it.

Save battery + Rich content , yet still free.

anyone support this?

@kwokkeunglam
Could you please clarify what you mean?

As mentioned GCM will be replaced by a firebase implemention until feb. 2019.
I also think that would be a show stopper of using this project. But from a java developer perspective I think it could be a hard work to find informations about the new apis. Especially if google is still extending their cloud service infrastructure. A second problem is that this project has still only one maintainer, which was still mentioned in the other discussions. But that will slow down the development in the future.

@kwokkeunglam and @dropicallus
If your idea is to create a new push service aside GCM/FCM, this is admirable, but way out of scope of this issue and project.
Microg was created to mimic the Google APIs, so apps that are utilizing Google APIs would run on a phone without the Google framework. To now create a new push system, you would need a new API, infrastructure and convince every app out there to use it.
Feel free to setup anything to do so, but please understand that this issue and bounty is about FCM within the Google API.

@chris42

  1. a push notification ecosystem completely independent of google

  2. I have a plan to use UDP, each message have bytes (8 byte header + 65,527 bytes of data) and fit inside one datagram. ( * fit inside one datagram means you either receive the whole message or you don't receive it. )
    after some data used for protocol , such as QoS, resend, deduplicate, encryption, signature, etc;
    still have around 60000 bytes available for use.

( encryption is a must as UDP do not have it, need to do by ourselves )
Encryption and sign can be done using developer's certificate, like APNS.

There can be feedback UDP message send back to server after receive, or the message will try to resend again.

  1. the foot-print shall be small enough. Works both as an embedded service or as a central service.
    The SDK will ask user to install a push-service from F-Droid / Any store;
    If central service is installed, all apps share one UDP connection to backend, which can feature save energy.
    Otherwise, the app can start embedded service to receive push internally.

UDP socket itself is quite energy efficient.

  1. Cost & Developer acceptance:
    I am not a business man, but are we using letsencrypt for free?
    I am quite sure the cost is lower than running letsencrypt.

Push only require some server farm to run, no need to buy a C.A. cert.

@chris42 agree for the out of scope here.

@chris42 Thanks for your answer. No that’s not my opinion. I would agree that
@kwokkeunglam idea is out of scope. The only thing I mentioned is that we should find a good development process in the future because these kind of incompatibility issues will arise every time google is changing the api. And that could be very often a month.

for developer working on this, i can leave some hint:
there may be 2 approaches:

  1. reverse engineer FirebaseMessagingService, which partially pro-guarded.
  2. mimic on network level

subscribe can be done like this:

curl -X POST https://android.clients.google.com/c2dm/register3 -H "Authorization: AidLogin 3575596404796697204:6917559070365768661" -H "app: com.firstrowria.pushnotificationtester" -H "gcm_ver: 12874000" -H "User-Agent: Android-GCM/1.5 (generic_x86 KK)" -H "content-type: application/x-www-form-urlencoded" -H "Connection: Keep-Alive" -H "Accept-Encoding: identity" -H "content-length: 206" -d "sender=197533215920&app=com.firstrowria.pushnotificationtester&device=3575596404796697204&cert=1acbe3831cb1827bee6a78879501d7c3bc074987&app_ver=7&info=Q4e--_NDkr0fUO6eTSP7b7Uo8wDiVxY&gcm_ver=12874000&plat=0"

will get a reply : token=....
which is the push token.

@kwokkeunglam This is already implemented in microG since long time.

FCM is not very well defined as it is 90% GCM in the backend logic and in communication between play services app (or microG) and the google services. I think the only relevant feature of FCM not present before is message channels / topics, which are not yet supported by microG (but also rarely used by apps). I guess GCM and FCM are mostly marketing terms (originally, the technology was called C2DM for client-to-device-messaging, and this term is still used internally in many places). For microG we should probably just call it push messaging.

9e0ee103a145564b1b33158a6b83697021d7ea9e fixes an issue that caused some newer apps to be unable to register for push messaging.

@mar-v-in This brings up two questions:

  1. Shouldn't you claim this substantial bounty since you basically fixed the problem everyone has with GCM even though you technically did not fully implement FCM?

  2. Why do both LineageOS for MicroG and F-Droid not offer this updated version? I also saw you pull some new changes to gsmCore today. I think the current surge of bounty money and comments stem from the fact that we still are stuck on 0.2.4-111-gf1cdb48 and thus receive those warnings with Discord, Protonmail and so on.

  1. Not sure about the bounty. As mentioned above, it is not well defined what FCM includes, but certainly the FCM implementation is not completed yet. This issue also has a lot of not-so-much-on-topic discussions about a new shiny open source replacement for push messaging (there are quite some of those out there already, because everyone wants to re-invent the wheel as they think they know things better, and in the end its still worse than Google, because Google has special handling by many ISPs, especially in US).
    I am not sure what exactly the bounty donators want to be done. Maybe those who did the donation can share what they expected from that bounty (@chris42, @GwenWing, @jacen05, @drrossum, @dicer, @bilbonotry, @avigoureux) - I am happy to reschedule those bounties to more properly defined issues and/or if the bounty was mostly about getting things running again (as it is now using 9e0ee10), I can also accept it as a donation to the project.

  2. The microG F-Droid server and website are already update. The F-Droid client caches the current database for about a day, but you can manually update the database by pulling down on the main screen - if you don't do it you will see the update for 0.2.5.12879 probably tomorrow. Of course this requires you to set up the microG F-Droid repo in your client.
    A future version of LineageOS for microG will contain the updated release, but you can also install the updated version 0.2.5.12879 directly from the microG F-Droid, download page or from GitHub release section.

@mar-v-in
Good to hear from you and thanks for the changes! I am just trying them, probably will know tomorrow if they solved the original issue.
The idea of the bounty was to get push messaging going again, as described above https://github.com/microg/android_packages_apps_GmsCore/issues/439#issuecomment-415826803
If this solves it, I am happy to donate the remains of the bounty to the project.

Long discussion here so I might as well chime in. . .

First, thank you @mar-v-in for everything! I noticed the update in F-Droid earlier today and it installs just fine on my Lineage with microG phone.

Regarding the suggestion from @kwokkeunglam about totally replacing Google on the push messaging: I think that is a non-starter for this project for a very simple reason. MicroG is targeted to allowing apps written for distribution through the Play Store to run on a phone without gapps. As such the app developer's server side mechanisms are setup to use Google for push messaging. It is unlikely that you will be able to change that.

Your only hope would be to add a new push mechanism in addition to supporting Google's and then work to get app developers to migrate to it. That, however, need not be within the scope of this project.

@mar-v-in I indeed received an update today and it works great! Thanks a lot Marvin. I was confused by you saying the fix was present for a long time alredy and referring to an 3 months old commit. But I guess the commit made today by you was what was missing.

I will donate directly to the project and not to the issue so you can claim and use the money easier.

Cheers!

PS: If I were you, I would direct this bounty towards the project. Everyone that donated clearly was interested in Notifications working again and you delivered on that today. The off topic and especially the crazy idea of creating an own notification service was introduced by non-donators so it's irrelevant what those said even if a donator replied to them after donating. Chris set the goal in his initial thread and the first donation arrived after his final edit. So everyone who donate shared his goal.

I agree with most of the previous comments here:

  • If we can register app in FCM as we can with GCM, and get push notification working, @mar-v-in should claim the bounty. As a donator for the bounty, I think I got what I expected (though not tested yet).
  • The idea of an Open-Source push notification system is interesting, but out of topic for this issue.
  • Thanks for your work @mar-v-in !

Sry guys, I really don't get. It seems that the problem isn't solved with the update at least for me. There are many apps which do not register for push messages like Whatsapp, N26 or local news. I'm able to turn on & off push settings in those apps but it won't have any impact. (and yes I've installed all apps fresh) Protonmail & Push Tester are the only apps working :/

Thanks for the fix!
I agree too. What we're seeking is the best possible support for notifications without Google Services enabled, whatever it is FCM or GCM.
Earlier I read some people say that microG won't work with FCM, and that since Google will kill GCM next year, notifications won't work at all anymore with microG.
So maybe it would be useful to state loud at microG website that it supports both FCM and GCM.
That's a kind of "marketing" message but it would prevent FUD about the project.

@mar-v-in As one of the bounty funders I would define my goal as follows:

Implementation of all relevant FCM features regarding messaging/push. What is relevant? Well, I don't know either GCM nor FCM APIs, so it's hard to say. I guess, everything that an app needs to enable push. This might include push modes that no major app uses yet (but might in the future) and other new push features (app to app, encrypted push etc). Again: no idea what the FCM/GCM feature base is! These are just examples I made up!
Of course the API does not need to be implemented completely. I don't need/want analystics and stuff like that which has no real benefit to the user and does not break apps.

So I guess it is really up to you @mar-v-in to look through the api and decide whether you think it's feature complete for our purposes.

If you think so, I'm happy to pay out the money. If you think there is important stuff missing that will break apps as soon as more developers adopt those functions, I would appreciate a list of classes/methods that need implementation. Then that should be the new goal of the bounty.

As a minor donator, I agree with @jacen05, I think the bounty aim was to
make FCM push messaging work.
But a status of what is implemented in FCM and what is not would be nice.
But I did not contribute much money...

Le mer. 29 août 2018 à 16:19, Felix Knecht notifications@github.com a
écrit :

@mar-v-in As one of the bounty funders I would define my goal as follows:

Implementation of all relevant FCM features regarding messaging/push. What
is relevant? Well, I don't know either GCM nor FCM APIs, so it's hard to
say. I guess, everything that an app needs to enable push. This might
include push modes that no major app uses yet (but might in the future) and
other new push features (app to app, encrypted push etc). Again: no idea
what the FCM/GCM feature base is! These are just examples I made up!
Of course the API does not need to be implemented completely. I don't
need/want analystics and stuff like that which has no real benefit to the
user and does not break apps.

So I guess it is really up to you @mar-v-in to look through the api and
decide whether you think it's feature complete for our purposes.

If you think so, I'm happy to pay out the money. If you think there is
important stuff missing that will break apps as soon as more developers
adopt those functions, I would appreciate a list of classes/methods that
need implementation. Then that should be the new goal of the bounty.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microg/android_packages_apps_GmsCore/issues/439#issuecomment-416970455,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARmvDJLtsCpZBUvIPiaC1dgPH4iRrWM_ks5uVqLogaJpZM4QcsUy
.

sorry for off topic,
I would like to gather some help and suggestion for a new push notification system.

https://www.indiegogo.com/project/preview/aef58fc2#/
( not launched yet, helpers and suggestions wanted )

This is sth I always want to make, one step ahead to make android "google free" .

@mar-v-in and all:
I tried the new version and it is not working for Whatsapp or Threema. Both won't register and will fall back to polling mechanism.

Within Threema I can pinpoint the error in the log and it seems to have changed from the registration not allowed (previous error above) to

08-30 08:51:18.530 W/System.err(25029): java.io.IOException: TIMEOUT
08-30 08:51:18.531 W/System.err(25029):     at bpi.a(Unknown Source:0)
08-30 08:51:18.531 W/System.err(25029):     at ch.threema.app.GcmRegistrationIntentService.onHandleIntent(SourceFile:4000)
08-30 08:51:18.531 W/System.err(25029):     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76)
08-30 08:51:18.531 W/System.err(25029):     at android.os.Handler.dispatchMessage(Handler.java:106)
08-30 08:51:18.531 W/System.err(25029):     at android.os.Looper.loop(Looper.java:164)
08-30 08:51:18.531 W/System.err(25029):     at android.os.HandlerThread.run(HandlerThread.java:65)
08-30 08:51:18.531 E/Threema (25029): java.io.IOException: TIMEOUT

With Whatsapp it seems more tricky, as I cannot find a logged error during registration. I found some Firebase related stuff after installation, in which at least Auth is stated as failed, but I am not sure if this has to do with the problem:

08-30 09:05:33.078 D/FirebaseApp(29496): com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
08-30 09:05:33.080 D/FirebaseApp(29496): com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
08-30 09:05:33.083 W/FirebaseInstanceId(29496): Failed to resolve IID implementation package, falling back
08-30 09:05:33.089 I/FirebaseInitProvider(29496): FirebaseApp initialization successful
08-30 09:05:33.097 I/FA      (29496): Collection disabled with firebase_analytics_collection_deactivated=1
08-30 09:05:33.097 I/FA      (29496): App measurement is starting up, version: 11910
08-30 09:05:33.097 I/FA      (29496): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
08-30 09:05:33.097 I/FA      (29496): To enable faster debug mode event logging run:
08-30 09:05:33.097 I/FA      (29496):   adb shell setprop debug.firebase.analytics.app com.whatsapp

Poking around the net for these errors, I found the following Link: https://github.com/firebase/quickstart-android on which apparently some people try to help getting into Firebase. Maybe that helps to figure out how firebase works and what maybe goes wrong. Also it seems to give some view on functionality (@dicer ).

For now I would say this issue needs more work to be solved. If I can help producing more logs or test anything. Let me know.

So to update my previous comment:
After receiving a few messages, I actually see Whatsapp in the list of the Apps using push messaging.
BUT it says not registered and the messages are not counted as well.

I deactivated battery optimization for Whatsapp and will see if message delivery is on time (this is usally not the case in polling mode with battery optimization deactivated). This could give us a hint if push is actually be used.

So summary still stands as:
For now I would say this issue needs more work to be solved. If I can help producing more logs or test anything. Let me know.

@kwokkeunglam I don't see the need for another centralized push messaging service (there are already a few, some proprietary, some open source). Something interesting could be a decentralized/federated push messaging service. This is more likely to break out of restricted regions like China and has no risk of going down because the service is not profitable (already happened to some of them). If you base upon XMPP or IMAP, you'd already have a huge federated infrastructure you could use, plus ready to use server and client software.

@chris42 Threema uses its own client implementation for push messaging and always needs special handling ;)

I will send you a few debugging commands for WhatsApp later.

I'd really appreciate if we could keep the ridiculous off topic out of this issue. It's very distracting from the actual issue and it's making it very hard for @mar-v-in to claim his bounty.

Please create your own project if you want to tackle such a big task.

PS: This rant is obviously not directed at you, Marvin. Thanks for keeping your cool and investing your time for our all benefit. If you need help with cleaning up issues from off topic content I'll gladly help.

@mar-v-in
It is getting weirder ;-) Just checked the detailed report in Microg for Whatsapp. It shows not registered as well, but also it shows 3 Messages as logged from a hour ago. Since then I probably got 20 messages. Not sure what it is doing.

It seems to be some bug in microg. For about half of my apps it says "Not Registered" in the apps list, but push notifications seem to work fine (e.g. Telegram X, WhatsApp, Riot.im). In the details of the specific app it does however correctly show the number of received messages and the correct time of the last one.

Yes, I can confirm there is a bug that causes some newly registered apps to not show up as registered (but those are still properly registered and receive push messages).

I also noticed that some (very few) apps still don't register for push messages...

@mar-v-in
Any update on this? let me know if I can help with tests or debug.

One of the apps that don't work for me is IFTTT. It doesn't show up on the list of registered apps as well. I've set up a simple task and apparently it triggered as intended but I never received the notification.

I reinstalled the app, here's the log from that point on: https://pastebin.com/W70z4xdF. One line that caught my eye is the following:
09-04 22:35:41.784 I/AppSecurityPermissions( 5884): Ignoring unknown permission:com.ifttt.ifttt.permission.C2D_MESSAGE

I have to admit I don't know anything about that stuff but I hope this helps a little.

Just to help a few people trying to figure out if push messaging is working or not, please check the following:

  • you are using newest microg version 0.2.5-12879 running (ale5000 installer is updated and should be very helpful)
  • you deactivated battery optimization for microg
  • you activated google device registration
  • you get all the green checkmarks in microg diagnostics
  • you made sure nothing is blocking network traffic to mtalk.google.com (e.g. afwall, adaway, ...)
  • you deleted the app you have troubles with and installed it fresh after updating to microg 0.2.5-12879
  • you have not used backup solutions, like oandbackup, titaniumbackup, ... to restore app data
  • you can also use the push notification tester to check. I just tried it and it works.

To verify incoming messages, look in you logs and search for "GmsGcmMcsInput". You should see the heartbeat and Incoming messages. In the incoming messages there should be a category stating your apps package. This should be messages your receive via push. (@mar-v-in I hope this is correct?!)

Freshly installed LineageOS OmniROM 8.1 (unofficial build for Sony Xperia Z3 compact), GmsCore 0.2.5.12879:

  • Push Notification tester works after creating a Google Account (The "self-check" should check for a missing Google Account, I guess).
  • Quizduell seems to work, too. It shows up as "not registered", but this is a different and known issue.
  • WhatsApp initially didn't show up in the list of apps using GCM. Yet it still managed to register somehow, because it was able to receive a message after a force quit operation. This left me quite baffled, because GCM seems to be the only way to be woken up after force quit. And yes: WhatsApp in fact is in the list now.
  • Threema can't register (seems to be #509)
  • DB Naviagator (official App for the biggest German Train company) can't register. It feels like in threema: After activating Cloud Messaging, nothing happens, and when pushing the activation button again, I get a message that the registration process is still in progress.

I am most interested in whether input on the DB Navigator issue is considered helpful. The other items from my list seem to match known behaviour.

Thanks a lot for the update, I installed it and tested the following:

  • Whatsapp and other "regular apps" register, show up in registered devices and count messages are shown. However it shows only my last message from before the reinstall, but not the ones received since then.
  • Threema is registering without the previously logged error and shows up in the list of registered app. It also receives messages, however they are not counted in microg.
  • DB Navigator (@karcherm ) is registering without error and shows up in the list of registered apps. But I am not traveling right now, so can't check functionality.

@mar-v-in
Overall messages are on time (seems to use push).
But when receiving messages, I cannot find GmsGcmMcsInput logs as in the version before. However with every message I get a GmsWearSvc GetServiceRequest for the apps (Whatsapp, Threema, DB Navigator).

Is this correct?

@chris42 Threema keeps a connection open for about two minutes after closing it and in this time, messages are pushed through that connection and not through GCM. Are you sure you waited at least that time before receiving a message?

@mar-v-in
Surely was impatient. :-) But do you mean Threema or GCM overall?
Just checked with Whatsapp and Threema:
I get GmsGcmMcsInput after waiting a few minutes in both before receiving messages. And they are getting counted. However the ones right after that are again missing in log and count.
So I assume the ones in McsInput get counted, but not the ones in existing connections?

With all this, I would consider this issue solved.
The requested functionality for the bounty is solved as well:

Registering apps in Microg with current functionality of whitelist should work again
Message counter as usual, to verify, that messaging is working
Push messages are delivered on time and reliable
Message notification is working as usual

@mar-v-in Happy if you claim the bounty. If you do not want to claim it, let me know, then I can reallocate it.

I consider this issue fixed then.

@chris42 this was about Threema. "existing connection" is referring to a network connection directly between Threema App and their servers. Not all messages are routed through GCM, only those that need to, i.e. when it is not possible within the app, because the app was closed for some time (the reason for that is that GCM has some rate limiting, so it is not possible to route all chat messages through GCM in real time).

RE bounty: I am happy to claim it, just wanted to make sure that nobody feels that something important is missing.

With a fresh install of lineageOS 14.1 for microg (0.2.5-12879) the google play version of riot is not able to register.
When changing the gcm settings in the app, it tries to force register and fails. I get this toaster: https://github.com/vector-im/riot-android/blob/05b9532a29b420411d7674172608b8ae3c488fc8/vector/src/main/java/im/vector/gcm/GcmRegistrationManager.java#L609
Logcat gives:

09-29 22:53:49.484  3506  3506 D GmsGcmRegisterSvc: onBind: Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
09-29 22:53:49.502  3506  5021 D GmsHttpFormClient: -- Request --
09-29 22:53:49.502  3506  5021 D GmsHttpFormClient: X-GOOG.USER_AID=0&device=0&app=im.vector.alpha&cert=xxxxxx&app_ver=81500&sender=xxxx
09-29 22:53:49.543  3506  5021 D GmsHttpFormClient: -- Response --
09-29 22:53:49.543  3506  5021 D GmsHttpFormClient: Error=PHONE_REGISTRATION_ERROR
09-29 22:53:49.544  3506  5021 D GmsGcmRegisterSvc: received response: RegisterResponse{token='null', retryAfter='null', deleted='null'}
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId: Unexpected response: Bundle[{registration_id=null}]
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId: java.lang.Throwable
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at com.google.firebase.iid.zzq.zza(Unknown Source)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at com.google.firebase.iid.zzq.zza(Unknown Source)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at com.google.firebase.iid.zzt.then(Unknown Source)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at com.google.android.gms.tasks.zzd.run(Unknown Source)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
09-29 22:53:49.549  4829  5019 W FirebaseInstanceId:    at java.lang.Thread.run(Thread.java:761)
09-29 22:53:49.550  4829  4848 E FirebaseInstanceId: Token retrieval failed: SERVICE_NOT_AVAILABLE

Microg settings say 0 apps are registered with gcm. Riot does not receive call any notifications when polling is disable and the app is not in the foreground.
I have no fire-walling app or so, microg self-test is all green.

Could you please check version 0.2.6-13280 and see if you still have an issue? Then it possibly makes sense to open a specific issue for that app.

Same result with 0.2.6.13280 even after uninstalling/reinstalling the app. I'll open a new issue.

I freshly installed Lineage OS for microg 15.1 with GsmCore Version 0.2.6.13280 and i checked that:

  • google device registration is active
  • all the green checkmarks in microg diagnostics are there
  • nothing is blocking network traffic to mtalk.google.com (e.g. afwall, adaway, ...)

But never the less I can't get any app to register to Google Cloud Messaging. I even checked with notification tester but it fails to "Register for Push Notification". Any idea what might cause the problems? I attached a log file. push_notification_tester_log_1.txt

EDIT: today out of the blue, everything seems to work just fine! All the apps registered correctly. Maybe it took some time for the google device registration to go through?

I got the symptoms you described until I added a GMS Google account in the android settings. I don't remember whether I had to reboot after that for push notifications to work.

There seems to be an issue with automatic device registration in latest version. If you have similar issues as described by @Mafus1, open the system phone app and dial *#*#2432546#*#* to do a manual device registration.

I didn't have to add a GMS Google account like @karcherm said, but maybe this works for others. If I have the Problem again, I will try what @mar-v-in suggested.

I was in the same condition as @Mafus1 (LineageOS 15.1 with microg 0.2.6.13280, clean installation). Followed @karcherm strategy with a reboot and now GCM is connected.

Excuse any formatting issues, did this on mobile.

I can confirm that I had to do a manual device registration with the code provided above on LOS 14.1, official microG 13280.

I have LineageOS 15.1 with microG 0.2.6.13280 and had to dial code that @mar-v-in suggested to connect Google Cloud Messaging

I think there might be some minor FCM logic missing from the latest version in relation to gms checkin. I can tell using the "Push Notification Tester" app on microG's download page that v2.6 of the tester app does not work on clean installs (it does work after a device registration succeeded), but v2.5 works fine after a clean install. In the changelog it says v2.6 is when the author added FCM support.

I think microG does a checkin automatically when a GCM token is requested, I think maybe this is being skipped with FCM token requests? Else, if fcm tokens don't occur through microG, maybe make it so it'll always attempt a gcm checkin (if needed) whenever something in the gcm pipline happens (connection, registration, etc).

Related to #313

This is obviously not fixed. Why was a bounty paid out and this issue closed?

@lifranc
Please read the issue thread, the comments of the backers and observe the timeline.

@lifranc
Most FCM apps are now working (which is what this ticket was about).
For the other different or new problems you need to open a different ticket.

Was this page helpful?
0 / 5 - 0 ratings