UnifiedPush / flutter-connector

Mirror of https://codeberg.org/UnifiedPush/flutter-connector
Apache License 2.0
31 stars 11 forks source link

D-Bus when running on Linux #45

Open yu-re-ka opened 2 years ago

karmanyaahm commented 2 years ago

@MatMaul I was previously working on https://github.com/karmanyaahm/flutter-connector/tree/platform_interface and #48

And once the platform interface was complete I wanted to do https://github.com/karmanyaahm/flutter-connector/tree/linux/unifiedpush_linux/lib

Though I never finished that work and haven't worked on it for a little while, so I don't really know.

I'm just curious, are you trying to make a platform interface or are you modifying the method channel or is it something else entirely?

Regardless, it's really nice that someone is interested in the linux version of this project :smiley:

MatMaul commented 2 years ago

@karmanyaahm Oh nice ! So I am doing something pretty similar with a platform interface. However my interface is quite closer to the spec, instead of being modeled on the current code.

Which mainly means that I ditched instance and use token directly instead, which just make sense to me 😊.

I don't really need to change the Android connector code to be honest, the code left is basically only creating and sending intents so I think I am going to copy the code as a first try.

I haven't begin the D-Bus code so nice to see yours ! I was going to also use the existing flutter D-Bus library.

I am trying to get a prototype working with that and will push something in a PR, then I think we can iterate from there ?

MatMaul commented 2 years ago

Oh and BTW sorry I've missed your PR... I remember having a look, but probably on the wrong project ^^

karmanyaahm commented 2 years ago

That makes sense. And thanks, it's nice to have you onboard UnifiedPush

provokateurin commented 2 years ago

Any updates on this? It would be awesome to have this working.

provokateurin commented 2 years ago

What distributors for d-bus exist? I can't see any listed in the docs.

karmanyaahm commented 2 years ago

Currently np2p, NextPush and ntfy have distributor implementations

There's not much practical progress though yet.

It would be awesome to have this working.

Yes, it would be for me too.

The main obstacle to the flutter implementation is recruiting help from someone who is skilled in GTK/Linux native APIs and how they interact with flutter for how background messaging should work. Receiving messages when the app is in the foreground is trivial compared to that (and I have implemented it previously)

provokateurin commented 2 years ago

first i think those providers should be added to the docs, because all distributors say there is only android support

provokateurin commented 2 years ago

second i'm not an expert in GTK, but i don't think it' necessary to do anything with that. from the docs i read that simply the executable is ran with a flag, right? it is pretty easy to just read that in flutter

karmanyaahm commented 2 years ago

first i think those providers should be added to the docs, because all distributors say there is only android support

They are not production ready yet, and they won't be until there is support from at least one app, and we can test compatibility properly.

from the docs i read that simply the executable is ran with a flag, right it is pretty easy to just read that in flutter

It is easy to read the flag. The main problem is that flutter code doesn't execute unless there's a window, which we don't want for background notifications. If I create a hidden dummy window, when someone clicks on the notification and an actual window needs to show up, but the hidden dummy window handles the click event (because it's handling D-Bus already). Everything quickly devolves into a mess from there because multi-window support in this context in flutter is awful. I'm sure it is possible, but a lot of things need to be worked out to make it practical.