Enable Browser Notifications
AlexNi245 opened this issue · comments
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.