@gotwf now I see the difference but I also don’t know how you would program that
Again I do need to learn how to make a plugin at some point
Is this still being maintained? It looks like this isn't flagged as supporting 1.4 yet. Want me to put in a GitHub issue?
@teh_g I'd like to see either this plugin or something similar support ServiceWorkers and push notifications.
@PitaJ I agree. That would be great.
What's the current status regarding mobile push notifications? The github says they're supported but I don't get them in Chrome for Android...
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:
Sorry for the necro, but for me the plugin seems broken. - As far as I can see, the code on github looks fine. Anyone has an idea?
In what way is it broken?
The popup asking for permission is there, after that nothing is happening. I checked the server and browser log, no errors.
Tried on Chrome mobile, Linux and Windows and the progressive web app.
Just to be clear, a tab is open when you are testing the notifications, right?
@PitaJ yes. I tried mentions and chat, no notifications
@PitaJ I'd be more than happy to help. Without notifications that work on mobile a forum will have a very hard time to take off/be an alternative to facebook and whatsapp.
@PitaJ I have literally no clue what happened, but it works now.
All I did was disable the addon, wait a few days, reenable it and restart nodebb
Ok after a few days of testing:
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.
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.
@PitaJ any way I could contribute to the plugin? I can write the worker but I don't have the time to figure out the internals of nodebb right now.
@meredrica what are you planning on writing? A serviceworker?
@PitaJ Yea that's not a big deal to do really. I just need to know the API I should be polling client side. Maybe check if sock.js is connected and don't poll if it is.