dm3-org / dm3

The dm3 protocol | New standard of web3 messaging | Decentralized ENS-based registry | Secure end-to-end encryption | Easy dApp integration

Home Page:https://dm3.network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable Browser Notifications

AlexNi245 opened this issue · comments

commented

A user who receives messages while not logged in should be able to receive desktop notifications. This works similarly to the email notifications that are already built.

Use the Web Push API to facilitate the delivery. Read the following article to get started:
https://thecodebarbarian.com/sending-web-push-notifications-from-node-js.html

Frontend

  • Add Browser Notifications tab to Preferences menu.
  • Within this tab, the user should be able to configure browser notifications.
  • Request permissions from the browser when the user wants to subscribe to a notification.

Backend

  • Use web-push to dispatch notifications from the backend.
  • Inject keys needed for web push via environment variables.
  • Add a second notification channel "Browser".
  • Add an endpoint to let users subscribe to notifications.
  • Add an endpoint to let users unsubscribe from notifications.
  • Dispatch notifications using the WebSocketManager component.