Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Push notifications #1

Open
poVoq opened this issue Nov 24, 2019 · 9 comments
Open

Push notifications #1

poVoq opened this issue Nov 24, 2019 · 9 comments
Labels
enhancement New feature or request upstream Needs fix upstream

Comments

@poVoq
Copy link
Owner

poVoq commented Nov 24, 2019

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

@poVoq poVoq changed the title Push notificatons Push notifications Nov 24, 2019
@poVoq
Copy link
Owner Author

poVoq commented Nov 27, 2019

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.

@poVoq
Copy link
Owner Author

poVoq commented Dec 1, 2019

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?)

@poVoq
Copy link
Owner Author

poVoq commented Apr 1, 2020

https://github.com/UWPX/UWPX-Push-Server

New python based push proxy. Might be easier to modify than P2.

@poVoq poVoq added enhancement New feature or request upstream Needs fix upstream labels Aug 16, 2020
@poVoq
Copy link
Owner Author

poVoq commented Sep 15, 2020

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.

@poVoq
Copy link
Owner Author

poVoq commented Oct 3, 2020

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.

@poVoq
Copy link
Owner Author

poVoq commented Oct 6, 2020

Experimental webpush support for ConverseJS upstream: conversejs/converse.js#2153
Maybe if embedded Morph would support Webpush?

@poVoq
Copy link
Owner Author

poVoq commented Oct 31, 2020

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).

@poVoq
Copy link
Owner Author

poVoq commented Nov 1, 2020

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.

@poVoq
Copy link
Owner Author

poVoq commented Nov 7, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request upstream Needs fix upstream
Projects
None yet
Development

No branches or pull requests

1 participant