Looks like always-on push service will die:
Background Service Limitations
Google is pushing for FCM as the only way messaging apps can function, but the open source client doesn't look ready for production.
Let's see what upstream comes up with 馃槃
Options:
Conversations seems to have solved this problem by using a proxy service in between the user and GCM/FCM
How do XEP-0357: Push Notifications work?
You need to be running the Play Store version of Conversations and your server needs to support push notifications.鹿 Because Google Cloud Notifications (GCM) are tied with an API key to a specific app your server can not initiate the push message directly. Instead your server will send the push notification to the Conversations App server (operated by us) which then acts as a proxy and initiates the push message for you. The push message sent from our App server through GCM doesn鈥檛 contain any personal information. It is just an empty message which will wake up your device and tell Conversations to reconnect to your server. The information send from your server to our App server depends on the configuration of your server but can be limited to your account name. (In any case the Conversations App server won't redirect any information through GCM even if your server sends this information.)
https://github.com/siacs/Conversations#how-do-xep-0357-push-notifications-work
@mastad0n which just reiterates the problem of not having a reliable FCM foss library
Finally, Telegram is working on adapting changes for Android O.
They added this (atleast) in yesterday's beta version.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="org.telegram.messenger.beta" platformBuildVersionCode="26" platformBuildVersionName="8.0.0">
hey sorry to hijack this issue report, but I hope you guys know:
When using Android 8.0, will the current FOSS version of Telegram not receive messages?
Thank you!
@utack restrictions should only apply for apps built with O in mind, so everything should work fine
@thermatk appreciate your help, thank you!
GCM is not an option. Most of Telegram-FOSS users are using it, because they don't want anything from google on their devices.
Upstream didn't come up with a solution yet, continuing to target sdk 25 in v4.6
I think the best approach would be to have a persistent notification in a special notification channel, so that one could hide it without affecting other notifications. Yet upstream can kill the background service in code when it's not useful for them anymore, forcing us to reimplement and maintain it 馃槩
Upstream didn't come up with a solution yet, continuing to target sdk 25 in v4.6
They'll like better have soon.
Maybe have a look and discuss the idea that FOSS projects could consolidate on an alternative standard to do push messages that leverages on the IMAP push:
Start at https://github.com/nextcloud/talk-android/issues/58#issuecomment-364872566
(CC @Bubu from related #216)
@thermatk
you wrote for the options:
Being ok with a JobService running once in 15+ minutes
Why it could not be run every second ?
https://developer.android.com/reference/android/app/job/JobInfo.html#getIntervalMillis()
--
Otherways.. +1 for consolidated FOSS project for push messages.
Hmm... this would be a trick, but could the JobService be used to start the app's background service again?
No. In Doze mode, there's only few way to wake up, and the JobService is not one of them.
Only available are: GCM, Alarm (with min period of 15mn IIRC)
See here
Only available are: GCM
I guess like it make sense to "reunite" all the outbound activities under a single common umbrella.
And for as much anything is technically possible, I cannot see how any reasonable solution would involve a telegram-only-side reinvention of the wheel.
Imo, it's microg or nothing.
I cannot see how any reasonable solution would involve a telegram-only-side reinvention of the wheel.
Imo, it's microg or nothing.
Or implementing https://gitlab.com/foss-push/planning, to not depend on google servers.
Mhh, I dunno - there doesn't seem to be lots of code (or any at all, that is)
(also, I'm not sure why not implementing that already into microg then)
Right, currently there is only the library from the https://delta.chat messenger, that shows that it is possible.
MicroG isn't used on other FOSS phone OSes, but yes:
https://github.com/microg/android_packages_apps_GmsCore/issues/486
@ale5000-git which GCM library are you suggesting to use here, not to say it wouldn't solve the more general problem?
Apps can be compiled with microG GCM library or Google one to be used in conjunction with microG.
Running a job/alarm every second is a bad idea, it will result in heavy battery drain. Any push messaging solution will require server support as well, so that's ruled out (unless it's some intermediate server like in Conversations).
Telegram would not check in in MicroG GCM. Is this related?
The time has come, it gets killed :cry:
Ruslan, do you mean that Telegram-FOSS doesn't work/sync with MicroG GCM
implementation anymore? Or am I getting it wrong?
It never synced with GCM
I went the way of foreground service with a notification
https://github.com/Telegram-FOSS-Team/Telegram-FOSS/commit/1cae1455267fe7a37e2dd775fd3033931baf64e9

Can you just whitelist it in the "battery optimization" settings of the system?
https://gitlab.com/bitfireAT/davdroid prompts the user to do it on first run, and automatically adds itself to the whitelist when you press "yes"
@utack And drains massively battery for me then.
@cRaZy-bisCuiT That should not happen. Its then just excluded from "app standby" which blocks synchronization. Do you have specific measurements are is this just conjecture? We'd also be happy about such feedback on https://www.davdroid.com/forums/.
I dont' know why not tp use microg gcm library
@ZJaume because it doesn't work right now, and even if it would, could stop any random day
Did I understand correctly that turning off Push Notification channel for Telegram and disabling system drain notification is the best way for a user to deal with this? It will leave me with normal notifications, not drain energy and not kill Telegram process.
@mikken yes, probably have to merge #253
@thermatk microG GCM does work for me on android N. It even worked on early versions of android O for some months, but I couldn't get it back to work after some reinstall around 2018-04, which is why I switched back to N, and microG GCM has been working fine since then for me.
Edit: I use official Telegram, by the way, and cannot comment on the FOSS version...
@drrossum but do you know any app that actually uses the gcm client libraries? i.e. the thing that goes into the app, not the thing that goes in your rom.
How does Telegram X handle it? It isnt recognized by the System as "consuming" battery and sends me push notifications.
The Google Services arent activated on my device.
GCM works even if you're not logged in, just have to have gapps installed
But they are deactivated and it also says push notifications are not guaranteed because they're not active
Could you please add an option to use JobService? I'm perfectly fine with receiving notifications once in a 15 minutes anyway.
FOSS users should build their own images of Android to bypass this restriction.
And continue using the own push notification service of Telegram.
I dont' agree with you on this point, ajsb85. I do want FOSS and privacy, but I want to benefit from automation. You can not expect from everyone who wants to honour those principles to have their own building setup. I can not tell my grandma to have have that e.g. ;)
Someone said Google is open sourcing the FCM libraries. Any news on that end?
They seem to be doing good with that.
I'm not sure how that would be supposed to help into replacing it though.
The problem never was "secrecy" or "obscurity". It's just that the OS has a (_legit_, if you ask me) power-saving limitation against every other service.
F-droid has a nice post talking about it, where eventually the only somewhat reasonable solution came to be Jobs, for example
If that's still not good (understandably, considering telegram is IM, not e-mail), for as much as I can tell either you try some way to reinvent the wheel around FCM, or you just wait for microg to finally reach feature parity.
@mirh Unfortunately MicroG is somehow on hold I'd say. The guy is pretty busy and right now it does not seem like anything will be coming soon.
On January 17, 2019 3:22:56 PM GMT+01:00, cRaZy-bisCuiT notifications@github.com wrote:
@mirh Unfortunately MicroG is somehow on hold I'd say. The guy is
pretty busy and right now it does not seem like anything will be coming
soon.--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/Telegram-FOSS-Team/Telegram-FOSS/issues/172#issuecomment-455188566
See: https://chaos.social/@Bubu/101431614329523211
(N.b. https://chaos.social/@Bubu/101431600813890984 but that won't be of any use for telegram as you don't self host the server.)
@cRaZy-bisCuiT
The development of microG is continuing, a new version was also released.
@cRaZy-bisCuiT
The development of microG is continuing, a new version was also released.
Thank you very much for your efforts, it's much appreciated! Do you accept donations?
I did not intend to do any misconceptions about the project, it was just a snapshot of my impression of the time that I had.
I'm only an external collaborator but you can donate to the microG project here.
Most helpful comment
GCM is not an option. Most of Telegram-FOSS users are using it, because they don't want anything from google on their devices.