codema.in
Wed 21 Aug 2024 5:30PM

Receive push notifications even if an app is not running

PP Pirate Praveen Public Seen by 13

We should be able to receive messages via push notifications even if the app is currently not active (Unified Push).

BS

Badri Sunderarajan Thu 3 Oct 2024 9:06AM

What is the current status of this? I saw the D-Bus page for Unified Push and it looks like we already have a spec in place. In fact, it's similar to what I was imagining before I looked up the spec :)

Do we have to implement it in the system somehow (eg. in the shell or something) or is it mainly a question of getting the apps to support the spec?

PP

Pirate Praveen Thu 3 Oct 2024 10:00AM

@Badri Sunderarajan I think @Guido is already working on this for chatty/matrix.

PP

Pirate Praveen Thu 3 Oct 2024 10:04AM

BS

Badri Sunderarajan Thu 3 Oct 2024 10:13AM

Temporary interim hack: what KaiOS does is, it doesn't have push notifications, but it allows apps to set "wake up" timers every so often (eg. 15 minutes) for the system to wake the app and let it check for notifications. I think it might also be tied to the WiFi/mobile data connection status, since my podcast app refreshes as soon as I get connected to the Internet.

If an app includes a "open in the background, check for notifications, then close" startup option, we could set up some kind of cron job/timer to run the app in that mode periodically. It's not as efficient as real push notifications, since all apps will have to conduct their own polling every so often regardless of if they have notifications or not (and notifications will only come after a delay). But running N apps every X minutes is still better than having to keep N apps running continuously.

Update: after typing that I found @Guido's summary of server-side push notifications which includes the option of using systemd timers or doozed for waking up the app.

G

Guido Thu 3 Oct 2024 10:48AM

Next step here is to land https://gitlab.gnome.org/World/Chatty/-/merge_requests/1355 so we have a usable real world client for testing

BS

Badri Sunderarajan Sun 20 Oct 2024 4:01AM

Proof of concept using matrix (Fractal) on Librem 5 just dropped!

https://git.sr.ht/~chrichri/Librem5-wake-on-IM

In this case, the push server uses a phone call to wake up the phone when it is asleep (a workaround that may not be feasible for every one, but lets work start on other parts of the system till we figure out waking up the phone through WiFi/mobile data)

PP

Pirate Praveen Mon 4 Nov 2024 2:50PM

Asked the people currently working on it about possibility of raising funds https://gitlab.gnome.org/World/Chatty/-/merge_requests/1355#note_2265833

PP

Pirate Praveen Sat 9 Nov 2024 8:18AM

Looks like funding is not a concern and expecting some updates on this work soon.