[nodebb-plugin-desktop-notifications] Desktop Notifications (like GMail)
-
@teh_g I'd like to see either this plugin or something similar support ServiceWorkers and push notifications.
-
They should work by going through the browser push notifications, though I personally don't have them enabled.
When installed, the plugin should prompt you to allow notifications via a toaster alert at the bottom of the screen. Looks like this:
-
In what way is it broken?
-
Just to be clear, a tab is open when you are testing the notifications, right?
-
Ok after a few days of testing:
- After allowing notifications the tab has to be closed and reopened for them to work.
- I can't find a way to make them work on Chrome mobile or the PWA.
- Chat messages play the sound on mobile... sometimes. I think the chat has to be opened for this first.
- There are no desktop notifications for chat messages
I'm pretty close to giving up and moving to another forum software... which would be a real shame since NodeBB offers everything else that I need and I wrote an LDAP plugin.
-
@meredrica notifications will only work if the page is open and connected to the internet. We don't have a serviceworker or anything like that for delivering push notifications.
Chat messages don't create a notification for each message received (to avoid notification spam) , instead only creating a notification after a set delay after the last message received, if it isn't read in time. They should produce a sound every time, though. If this is not the case, please open a GitHub issue.
-
Potentially there's a use case for a service worker to check for notifications, perhaps that's something we can look into.
On the sounds front, however, I'm a little on the fence about whether we should keep them. Not many apps use sounds, though I think there are more than a few people using NodeBB who would appreciate us keeping them around.
That said, I think we'd need some new sound assets
-
@julian I think it would be a good idea to implement the worker. Maybe add it to the notification plugin? Or maybe a web worker, I'm not sure if that wouldn't be better.
Or maybe just a good old Javascript timer would do the trick.
Service workers can become very complicated and if you have bugs in them they are very hard to get rid of. I would not use them if you don't want to have offline functionality.
-
@meredrica I don't think there's an instance where a timer or webworker would stay alive when a websockets connection wouldn't. Depending on how often we want to poll, opening a new connection periodically could be more expensive than just keeping the socket connection open.
-
@meredrica what are you planning on writing? A serviceworker?