Built-in push notifications for Android OSS without requiring a separate app

(#4201) Feature Open: In progress mobile notifications self-hosting

Current problem

I'm currently using GrapheneOS without Google Play Services, and I've installed the latest Fluxer Android OSS beta (betaoss) through Obtainium. I'm connecting to my own self-hosted Fluxer instance. As far as I understand, the OSS version currently relies on UnifiedPush and requires a separate distributor like ntfy to receive push notifications. I've been using GrapheneOS for several years now, and none of my other apps have ever required an additional push notification app. Everything has worked fine without one so far. I understand that UnifiedPush has its advantages, especially when several apps can share the same distributor. But in my case, I'd have to install and permanently run ntfy just for Fluxer. I'd really prefer to avoid installing additional apps and running more background services than necessary, especially since keeping my device minimal and reducing unnecessary dependencies is important to me.

Proposed change

I'd love to see an optional built-in push notification solution for the Android OSS version, similar to how Threema Libre handles notifications. Ideally, Fluxer would be able to maintain its own background connection and receive notifications without relying on Google Play Services or requiring a separate app like ntfy. The solution should work with both the official Fluxer service and self-hosted instances, preferably without requiring any additional server-side infrastructure. I'm not suggesting removing UnifiedPush. I understand why people might prefer it, especially if they already use it with other apps. It would just be nice to have both options: UnifiedPush for those who prefer it, and a built-in solution for those who don't want or need a separate distributor.

Platform

Android, Self-hosting

Additional information

Threema Libre is a good example of what I'm looking for. I've been using Threema Libre on GrapheneOS for quite some time, and its built-in push notification system works perfectly for me without Google Play Services or any additional push app. It maintains its own background connection, and notifications arrive reliably even when the app isn't open. I was wondering if something similar might be possible with Fluxer. Since Fluxer already uses Gateway/WebSocket connections for real-time communication, could some of that existing infrastructure potentially be reused for background notifications on Android? Of course, I don't know whether this would actually be suitable, especially considering Android's background restrictions and battery consumption. I'm just curious whether it could be an option. I'd be interested to hear if something like this has already been considered or if there are technical reasons why Fluxer currently relies entirely on external UnifiedPush distributors for the OSS build.

3 comments

Sign in with Fluxer to comment and vote.
Comment by mesub
mesubMod 1 vote
Status changed from Under consideration to In progress
This is being investigated.
Comment by sodiboo
none of my other apps have ever required an additional push notification app
how many other apps besides Threema do you even have that can actually send you push notifications? 'cause almost all apps definitely do require an external push provider. surely you don't have a dozen apps in the background constantly with open connections ???
I'd really prefer to avoid running more background services than necessary
that is why everything supports UnifiedPush or Firebase Cloud Messaging! it's precisely to prevent redundant background services that all compete for CPU time and battery life! it's why Android actively discourages implementing push notifications per app through its battery restrictions! it feels very odd to me for Fluxer to try and work around that. and. for what benefit? like, actually? i've only ever seen apps implement their own push notifications when the backend can't support UnifiedPush, for example with Molly, which can only use UnifiedPush on primary devices; with a fallback to the "app is open right now" connection running in the background on secondary devices. or Conversations, which uses XMPP, the instant messaging protocol that predates modern push notification infrastructure, so of course it needs to be able to listen to the XMPP protocol for chatting. when the XMPP server supports the relevant extension, it can also receive chat events over UnifiedPush, and because XMPP has this generalized real-time infrastructure anyways, Conversations also supports being a UnifiedPush provider.
Since Fluxer already uses Gateway/WebSocket connections for real-time communication, could some of that existing infrastructure potentially be reused for background notifications on Android?
absolutely! just like with XMPP. Fluxer is an instant messenger after all, and the gateway connection when the app is open is not very dissimilar to how dedicated push providers work. but consider the fact that Fluxer supports logging into multiple accounts on distinct instances. if you have five accounts, this would necessitate keeping five connections open 24/7. the power of UnifiedPush is that an app can subscribe to many channels without battery drain. it would be compelling for the Fluxer client and server to support a role similar to XMPP: a generalized real-time presence conduit. then, when logged into multiple instances, you could have all your push notifications running over one gateway instead of keeping five open in the background. but if that's supported between fluxer instances, there's no reason why it would need to stop at push notifications? i think having a way to proxy the non-push-notification Fluxer gateway events through a "home" instance would be pretty neat. this would also make "Federation v1" clients actually even remotely battery efficient, because you could listen for real-time Fluxer events on multiple instances without keeping multiple connections open. and, then it would also probably make sense to let Fluxer be a UnifiedPush provider (like Conversations); why not? people use Webhooks for arbitrary push notifications anyways, formatted as chat messages. Fluxer is already a push notification conduit; it just doesn't use WebPush for ingress.
Comment by Bingofps
Bingofps 2 votes
I came here to say the same thing , and to share examples of apps that have reliable notifications without a push server : Signal , Tuta , and even Whatsapp ! and another reason why some of us would prefer this approach : less metadata leak to a 3rd party (push server)