device maintains a single connection to Google server
vs
every app maintains their own connection to their server
device maintains a single connection to Google server
vs
every app maintains their own connection to their server
At least on Android you have two options: you use Google's notification API which lets your app sleep until the system wakes it back up on receiving a notification. Or you skip all that, then your app has to run in the background or you won't get notifications. You can guess what this does to your battery.
Decided to go the let app run in the background on graphene. With 3 apps in the background running all the time. Battery last 12 hours, with heavy use less. I'm unaware of how to get or self host push notifications outside of Google. It's not death to your battery but it defintely shaves off 20 percent and that's a rough number.
I've been using a pixel for 2 years with 600 plus cycles and my battery health is still 100 percent excellent, I did a hardware health check today.
Great. Now do 40 apps and try not to get them killed by the OOM mechanism. I'm not saying I like the fact that messages go through Google's servers, but I'm afraid there is no equivalent FOSS solution.
Why do you need to be constantly bombarded by notifications. I have one email client and 2 messaging apps that run in background all the time for notifications. And for all other apps I don't get and don't need notifications.
There is a FOSS alternative. ntfy.
I've been running it for a couple of years, if not longer. Works extremely well. The downside, of course, is getting the apps to support it.
The ones I care about already do.
That's fine for you and me, but not for the masses.
The problem isn't really 40 apps keeping connections open. That shouldn't cause much battery drain or RAM usage. Really really heavy emphasis on "shouldn't".
Too many shitty apps that keep doing shit when running in the background instead of just waiting for data to arrive. So Google takes the sledgehammer approach and just doesn't let apps do that and instead makes them rely on Google's one dedicated background app that they know behaves.
Good guy Google. Guess what? The developer of apps can deliberately hide or delay the push notifications if it detects its background optimization is enabled. Really, really emphasize on "can", not "should".
Centralized vs decentralized. I'm willing to sacrifice privacy for battery in this case, honestly.
Ntfy exists. I use it for 3-4 apps.
How do you get it to do discord and other random apps?
Can't do it with random apps, but most FOSS apps, like Molly (fork of Signal), Element (matrix protocol), Tusky (for Mastodon), etc. use this.
I think using it for discord can be possible, but you would have to set up your own notification server. Like for Signal chats, there has to be another server between my notification server and Signal's server (MollySocket), which listens to the notifications and sends it to my Ntfy. You will have to set something up that is always online waiting for new messages, and when new message arrives, it pings your Ntfy, and Ntfy pings your phone.
Is there any technical reason that it has to send your notification data to Google and Apple or is it just to get more data on you?
the API that for example Google Firebases provides (most used, as it supports ios and android), is basically "send a notification with following content to this device".
Which is very simple to implement. as it's just fire and forget. But you send the actual data to Google in this case.
There are way to do it differently, for example how signal does it: They send a silent (e.g. invisible) notification to the device, which has no data in it.
That notifiation tells the app to check for new messages.
The app will then fetch messages in the encrypted way as it always does, and displays a notification if needed. No need to send actual data through the notification service (other than the metadata, that notifications should be pulled)
More technically there's two ways to move data between two separate services. You can either pull or push the data.
Assume for both scenarios that the client is your phone and the server is some machine in the cloud.
With pulls the client calls an API and the server returns a response. Generally the www works this way. You ask a server for a wab page and you effectively pull the source down to your browser.
Pushes work the opposite, in that a server has data for the client and needs to push or otherwise give it to you. Pulls are relatively strait forward because every server has a well known name (the domain name and url). But your phone's IP address changes constantly. So how does a server know how to contact your device? There's generally two ways:
You could in theory implement either of these yourself but because of the way the OSes work on both Android and iOS there's no guarantee that you can keep a process running in the background forever. As the OS can kill your process if the OS needs more free ram, etc ... The built in notification APIs are exempt from this because they are part of the OS.
A loosely moderated place to ask open-ended questions
Search asklemmy ๐
If your post meets the following criteria, it's welcome here!
Looking for support?
Looking for a community?
~Icon~ ~by~ ~@Double_[email protected]~