Open poVoq opened 4 years ago
As an interim solution, HTML browser notifications would be nice. I have disabled them for now as I think they are not working, but maybe I just did something wrong.
This explains what is being send by the user's XMPP server as a message to the specified JID: https://xmpp.org/extensions/xep-0357.html#publishing
Could maybe also be used to bootstrap something with NodeRed (XMPP node in and a modified Push node out): this seems relevant: https://github.com/Xzya/node-red-contrib-push (apparently Google's Firebase and Ubports notifications work almost the same, just some variable name changes?)
https://github.com/UWPX/UWPX-Push-Server
New python based push proxy. Might be easier to modify than P2.
While there is some movement on webpush upstream, I doubt it will be supported by Morph (which behind the scenes is used here too) any time soon.
A possible workaround might be this: https://gitlab.com/danielside/mod_offlinesms It can send offline message notifications from the server to SMS, email and telegram. And I guess getting to to push to a Gotify server (there is a nice Gotify app for UT) could also be implemented without too much effort.
Another hack would be to try to re-base this on the pesbuk app: https://github.com/kugiigi/pesbuk-app Apparently if you remove background suspension via UT-tweaktool it can intercept the web notifications and push them to the UT notification bar. (edit: uses special custom code to intercept Facebook specific stuff, so not really an option here it seems)
I have previously tried to run ConverseJS in a qtwebengine app similar to pesbuk and that worked relatively well, so I guess it would be worth a try.
Experimental webpush support for ConverseJS upstream: https://github.com/conversejs/converse.js/pull/2153 Maybe if embedded Morph would support Webpush?
Seems like Morph is getting web-push in the near future (work in progress). Lets see if that can also be used with Morph based webapps like this one. But sadly it doesn't look like web-push support will be merged soon for ConverseJS upstream, and it would likely also require xmpp server side support (I think there might be something in progress for Prosody).
Hmm: https://github.com/balcy/example-webcontainer-notifications That might work with background suspension disabled... Edit: Only works with an WIP branch of Morph. I'll try it again when that is merged upstream. Looks promising though.
Pade (A ConverseJS fork as a browser plugin) has Webpush support. The relevant code seems to be this: https://github.com/igniterealtime/openfire-pade-plugin/blob/master/pade/classes/public/inverse/webpush.js Not sure if that can be backported or will ever reach upstream, but it might be a good starting point.
I researched this a bit. It seems like the way to do this would be to pass the info back to the XMPP server with mod_push enabled.
ConverseJS does it this way: https://conversejs.org/docs/html/configuration.html#push-app-servers
Apparently the XMPP server then creates an S2S connection to another hosted service that contacts the Google/Apple/etc. push notification service. There are several possible implementations for it (the ones I found): https://github.com/iNPUTmice/p2 (author willing to integrate Ubports notification service) https://github.com/ChatSecure/RubDub (complicated setup) https://github.com/esl/MongoosePush (Only with Mongoose XMPP server?)
Or directly as a Prosody module: https://github.com/tmolitor-stud-tu/mod_push_appserver
Related documentation on how it works in the case of Ubuntu Touch can be found here: http://docs.ubports.com/en/latest/appdev/guides/pushnotifications.html