45
submitted 2 days ago by [email protected] to c/[email protected]

So I always here about on how Google Android and IOS those companies can see all your notifications. This is because to show a notification it calls an API.

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?

top 15 comments
sorted by: hot top new old
[-] [email protected] 16 points 1 day ago

device maintains a single connection to Google server

vs

every app maintains their own connection to their server

[-] [email protected] 38 points 2 days ago

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.

[-] [email protected] 4 points 1 day ago* (last edited 1 day ago)

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.

[-] [email protected] 4 points 1 day ago

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.

[-] [email protected] 3 points 21 hours ago

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.

[-] [email protected] 6 points 1 day ago

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.

[-] [email protected] 3 points 1 day ago

That's fine for you and me, but not for the masses.

[-] [email protected] 5 points 1 day ago

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.

[-] [email protected] 2 points 10 hours ago

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".

[-] [email protected] 6 points 2 days ago

Centralized vs decentralized. I'm willing to sacrifice privacy for battery in this case, honestly.

[-] [email protected] 2 points 1 day ago

Ntfy exists. I use it for 3-4 apps.

[-] [email protected] 2 points 1 day ago

How do you get it to do discord and other random apps?

[-] [email protected] 2 points 1 day ago

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.

[-] [email protected] 22 points 2 days ago

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)

[-] [email protected] 8 points 2 days ago* (last edited 2 days ago)

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:

  1. Your device can poll (make repeated pulls to a server checking for new data)
  2. Or you can register some identifier and your IP address with some central server every time it changes. And then the server can essentially call a URL on your device directly. This is essentially what Google and Apple are doing as it doesn't waste CPU resources and your battery.

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.

this post was submitted on 04 Jun 2025
45 points (97.9% liked)

Asklemmy

48488 readers
705 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_[email protected]~

founded 6 years ago
MODERATORS