-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix push messaging registration for some apps
- Loading branch information
Showing
1 changed file
with
146 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mar-v-in thank you! This commit has enabled slack notifications on my device.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiciu did you have to reinstall slack for notifications to work?
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after update of microg, you need to reinstall every app that uses push notifications to register.
Please only install the app, do not use backup solutions (e.g. titanium backup, oandbackup, etc.) to restore the app or data.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chris42 When you say "reinstall" do you mean it is necessary to first uninstall the app (which deletes all backup data) and then install it again, or is just installing the app again sufficient?
p.s. Huge thanks to you @chris42 for the buildfix-1806 branch, as well as the continuous efforts to have this push issue resolved!
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NormalRa
yes, you need to uninstall first and then reinstall. I cannot speak for slack, but e.g. for Whatsapp, the app internal backup you created stays on the phone. You can use that to recover your messages with the restore in whatsapp on install.
However backup solutions like Titanium backup, etc. work differently and also backup the push registration as app data. Hence if you restore with that, you would reset your registration back to your old one. That would not work.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sm4rk0 I did not; I just started to receive chat notification out of blue. And at the same time I got "Your notifications are now mobile" email from slack.
But I'm pretty sure I did reboot my phone between updating microg and receiving first notification; not sure if this has something to do with it.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't the case for me. Most apps, such as WhatsApp, reregistered automatically after a while (a few hours).
These apps are listed as "Not Registered" in microg, but that seems to be just a bug. Push notifications work fine (battery optimizations on).
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an expert in GCM/FCM, but: I think that the update of the notification ID will depend on how the app is programmed. Both apparently provide some mechanisms to update the token ID like onTokenRefresh (GCM) and onNewToken (FCM).
My guess is that they're optional (but highly recommended) to be implemented, so some or most of them may already refresh on their own...
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chris42 Using WhatsApp's backup mechanism occurred to me, but I read somewhere that these are only 7-day backups. Would restoring such a backup restore the entire chat history?
Regardless, it seems that WhatsApp has appeared in the microG GCM listing as "Not registered" even though I had not uninstalled-then-installed. However, I did first reinstall the app and probably updated it in the meantime.
Also, presently, something feels a bit wonky because sometimes messages aren't received by WhatsApp and when I open the application from the launcher a deluge of messages occurs! This wasn't the case when no registration to GCM was possible since I had marked WhatsApp to not be optimized with respect to battery. Perhaps this is merely a symptom of Android's doze mechanism, or there needs to be more work on microG? Not sure.
@julienschmidt I can confirm that WhatsApp registered automatically for a while.
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for splitting the discussion from another issue. Let's continue there.
You'll also see that:
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).
9e0ee10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hiciu @julienschmidt You would be the first, but glad to hear that it works.
@NormalRa I was using the backup on the phone and it restored my whole history (at least I can find messages from 2015 on there)
The FAQ just states, that Whatsapp will offer the last 7 days of backups. Hence this should be a question of how many different backups you have, not the content.
Regarding the messages not arriving on time, could you check if microg is in your "not optimized" apps list. If so, this is normally a sign, that Whatsapp has fallen back to polling and I would recommend reinstall of Whatsapp.
BTW most of this should be discussed in issue #439 , not in the commit.