Skip to content

feat: implement UnifiedPush on Linux#2541

Draft
TheSunCat wants to merge 1 commit into
krille-chan:mainfrom
TheSunCat:feat/linuxnotifs
Draft

feat: implement UnifiedPush on Linux#2541
TheSunCat wants to merge 1 commit into
krille-chan:mainfrom
TheSunCat:feat/linuxnotifs

Conversation

@TheSunCat

Copy link
Copy Markdown
Contributor

Thank you so much for your contribution to FluffyChat ❤️❤️❤️

Pull Request has been tested on:

  • Android
  • iOS
  • Browser (Chromium based)
  • Browser (Firefox based)
  • Browser (WebKit based)
  • Desktop Linux
  • Desktop Windows
  • Desktop macOS

I decided to give it a go myself, just following the UnifiedPush Flutter connector's implementation (got a lot of help from their devs). The app will try to register on launch (like on Android) and give a dismissable message if not. If there are no available distributors, it will fallback to the old local notifications, otherwise everything goes through UnifiedPush. I mirrored most of the implementation from local_notifications_extension to push_helper, though it is quite annoying we have a duplicated impl for this (using different libraries).

Starting in the background is automatically handled for us by the UP library, it sets up a dbus activatable service that launches FluffyChat with a new flag --unifiedpush-bg, which causes it to take the same codepath as Android. Additionally, the env var FLUTTER_HEADLESS is defined and handled on the GTK/C side, as otherwise a black window opens for a couple seconds before UP can trigger hiding it.

Likely some polish is needed, but it's a start, and a very important feature for those of us running FluffyChat on Linux mobile. I am happy to make any changes, please let me know :)

Fixes #486

@TheSunCat TheSunCat force-pushed the feat/linuxnotifs branch 2 times, most recently from bc8e299 to 01c200b Compare February 7, 2026 21:48
@TheSunCat

Copy link
Copy Markdown
Contributor Author

I'm having some trouble testing it on my phone, mainly due to not being able to build an arm64 version from my x86_64 host. I'm looking into https://github.com/TheAppgineer/flatpak-flutter to make this easier (and just build it directly on my phone).

@krille-chan

Copy link
Copy Markdown
Owner

Wow that is great! Thank you so much :-) can't wait to try this out

Comment thread pubspec.yaml Outdated
flutter_webrtc: ^1.2.1
geolocator: ^14.0.2
go_router: ^17.0.1
handy_window: ^0.4.0

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this package somehow producing problems here? That would be sad as it makes the app afaik easier integrated into linux mobile

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unfortunately its changes to GTK handling seem to conflict with running Flutter headless which is needed for background notifications.

Out of curiosity, do you know how handy_window affects Linux mobile? I am running a build with all my MRs merged on my own phone, and have not yet noticed any regressions.
I am running GNOME Mobile and cannot easily test other interfaces, so perhaps it's important for other UIs?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have heard it from other users but that's already years ago so maybe it is fixed now. I don't have a Linux mobile device for myself to test it. So if it works for you it is probably fixed. However it's still a little bit sad that this removes the rounded corners at the bottom of the window :-/ it looks so much more modern and it's not in sight that canonical develops a gtk4 port soon... However that would something we could life with I guess

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try to see if I can find a way to make it work. I am currently struggling a lot with getting notifications in the background. I can start the app when a UP message comes through, but it never sends a notif.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a new package of handy_window. Does that help in some case?

@TheSunCat TheSunCat force-pushed the feat/linuxnotifs branch 3 times, most recently from d65c19e to c5bd78b Compare February 10, 2026 23:52
@TheSunCat TheSunCat marked this pull request as draft February 22, 2026 16:13
@TheSunCat

Copy link
Copy Markdown
Contributor Author

I've been running a Flatpak built with all my open merge requests, and sometimes upon starting FluffyChat I get an error about the SQLite database being already in use, and the app opens to a black window. If I close and reopen it, I am shown the login screen and I have to re-login to my account (and verify my session). This sucks, and we cannot merge this until that's fixed. I would really appreciate some help!

@Codrax

Codrax commented Jun 14, 2026

Copy link
Copy Markdown

Any updates on this?

@TheSunCat

Copy link
Copy Markdown
Contributor Author

Well it works, I run all my patches on my phone, but it has the issue with the SQLite database causing me to have to relog every day or so. Still waiting for help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Run in background on Linux

3 participants