The-Commit-Company / raven

Simple, open source team messaging platform
https://thecommit.company/products/raven
GNU Affero General Public License v3.0
287 stars 116 forks source link

[RAV-15] Web Push Notifications #547

Closed TITANiumRox closed 5 months ago

TITANiumRox commented 9 months ago

Steps to implement web push notifications:

  1. Create a Service Worker
  2. Get permission from user to receive push messages
  3. Get PushSubscription object:
  1. Send subscription to frappe server and save in database
  2. Send a Web Push Protocol request from frappe server to the Push Service

Notification should be received on the subscribed browser after the Web Push Protocol request is parsed and authenticated by the Push Service.

image

From SyncLinear.com | RAV-15

yahyaoudra commented 9 months ago

Hey is this feature to receive messages notification ? @TITANiumRox @nikkothari22

nikkothari22 commented 9 months ago

Hey is this feature to receive messages notification ? @TITANiumRox @nikkothari22

Yes. We're working on it.

We're trying one way to send web push notifications on Raven, while the FrappeHR team is also trying a different way. Hopefully, we'll have web push notification support in Frappe framework itself (probably powered by Frappe Cloud).

SalaAl-Homikany commented 7 months ago

Hey is this feature to receive messages notification ? @TITANiumRox @nikkothari22

Yes. We're working on it.

We're trying one way to send web push notifications on Raven, while the FrappeHR team is also trying a different way. Hopefully, we'll have web push notification support in Frappe framework itself (probably powered by Frappe Cloud).

What about now? Did the attempt to send notifications via the web succeed?

nikkothari22 commented 7 months ago

What about now? Did the attempt to send notifications via the web succeed?

Yeah we tried one approach where we don't use FCM and just did it directly via web push API. That worked on some browsers but not all.

On the other hand, the Frappe HR team have set up a relay server for notifications. That seemed to work on all browsers and we only need to implement it and test it on Raven which we're doing now. This would however work easily on Frappe Cloud since the relay server is on FC, but won't work when self hosting Raven.

For self hosting, users would also have to deploy the relay server app and the FCM config themselves. I'm not sure if that can run on the same server or not, but we'll provide documentation for this once the relay server app is tested and released.

This is also dependent on the Frappe framework itself - since the common controller is in FF, and hence push notifications might not work on older versions of Frappe framework.