Add true push notification support (particularly iOS and Android) and simple service worker <-> client communication#2356
Add true push notification support (particularly iOS and Android) and simple service worker <-> client communication#2356GigiaJ wants to merge 85 commits intocinnyapp:devfrom
Conversation
|
The internal update check will likely not live to the end, but is convenient to make sure the service workers are refreshed on mobile. Left to do (not inclusive as I might be forgetting something):
|
…o publicly host it unless it becomes irrational in cost which should never happen)
…g the user of them)
… (for token auth atm)
…rmine which should be used
|
FYI there's currently an open issue to add support for Unified Push, which feels very related to this PR. not sure if it's something you would consider building into this, or if you'd prefer to keep it separate. This would enable more comprehensive push notifications. |
This change should support UnifiedPush provided you are the individual hosting Cinny. The TLDR is that this is that change with the more Matrix centered implementation. In fact you likely can use ntfy (UnifiedPush) since it expects the pushkey, matrix gateway endpoint, and app_id in the same way even. |
|
Hi there, I recently made some changes to your PR to make webpush usable. My PWA on iPhone has been getting push notifications for months even after system reboot. I'd love to continue this PR and merge it into the upstream with you. I'd really appreciate it if you could review my code and give me your thoughts. It would be even better if we could solve any issues together. Please do contact me on Matrix at |
if event_id is not available, jump to inbox i haven't check app notification, this is for push notification for now
still need to handle invitation notification
…notification isn't enabled
currenttly all browser requrire a `push` produces a notification, if not, push subscription may be revoked. see: firebase/firebase-js-sdk#8010 (comment) in this case, sygnal, the push gateway will send unread count, and create a `push` event, when messages are read on other clients. Therefore we have no choice but to stop sygnal from pushing data that won't be presented as notifications see: https://github.com/element-hq/sygnal/blob/da48ba7457409391c1d12140ce2ea3d49d377ff3/sygnal/webpushpushkin.py#L142-L145
so that a notification will always be generated from a push event, avoiding being killed for privacy policies from browser and os
Sygnal already adds `mailto:` by itself. When added manually, apple will error out with `403: BadJwtToken`. Hence the mailto should be removed :) (cherry picked from commit 0d66762) Signed-off-by: Kris Hu <i@krishu.moe>
|
All contributors have signed the CLA ✍️ ✅ |
7419d52 to
37c76c7
Compare
|
I have read the CLA Document and I hereby sign the CLA |
|
We do not have this in roadmap yet. Will revisit once we move over to new SDK. |
Description
Adds true push notification support alongside a Sygnal server to target. This provides a straightforward push notification implementation for iOS users as well as Android.
Redesigns the current service worker implementation and provides a simplistic message system between the client and service worker. Adds a toggle to enable webpush notifs in addition to the current in app notif toggle in the settings menu. Adds config options for a push gateway to be set.
Provides an easy future avenue for just adding the app APN info and FCM info to the Sygnal instance should the release move from PWA on mobile to a full app release.
Currently I'm hosting a stock Sygnal instance in a docker container and a caddy instance in a docker container on a Vultr IPv6 only VPS. It is proxied through Cloudflare so no egress or ingress fees (should make the price extremely stable for bandwidth billing). Can read more here: https://blogs.vultr.com/vultr--cloudflare-bandwidth-alliance--win-win
https://www.cloudflare.com/bandwidth-alliance/
Currently happy to pay for the hosting fees for the domain included (cinny.cc) and the VPS which comes out to $3.50/mo.
I'm also happy to work some sort of transfer or change in ownership out as well if that is preferred.
I'll be including docs to reproduce for those who want to privately host instead. (I'd also be willing to write some Pulumi IaC for it at some point.)
Fixes #
#17 (Partially)
Type of change
Checklist: