@Tanner said in The Plugin Ideas Topic:
XMPP integration with chat (have the protocol be tied to an XMPP server)
I still really want this one. Or integration to Rocket would be even better.
This NodeBB plugin uses the HTML5 Notifications API to display desktop alerts upon new incoming notifications.
If you have a forum logo set it will use that as the notification icon. Clicking on the notification will take you the appropriate thread.
Install via NPM:
npm install nodebb-plugin-desktop-notifications
When the user clicks on the notification icon in the menu, a permission dialog is launched to activate desktop notifications.
Also supports push notifications on mobile:
Even when the browser is minimized, you can still get a notification.
More info on Github
Amazzzing. I figured this was coming sooner or later. Nice work!
Congrats!
It is worth noting that this is not compatible with Internet Explorer (not surprisingly).
info: NodeBB v0.2.0 Copyright (C) 2013 DesignCreatePlay Inc.
info: This program comes with ABSOLUTELY NO WARRANTY.
info: This is free software, and you are welcome to redistribute it under certain conditions.
info:
info: Initializing NodeBB v0.2.0, on port ---, using Redis store at 127.0.0.1:----.
info: NodeBB instance bound to: Any address (0.0.0.0)
info: NodeBB Ready
/home/c/src/meta.js:218
mtime = +new Date(item.mtime);
^
TypeError: Cannot read property 'mtime' of undefined
at /home/c/src/meta.js:218:32
at /home/c/node_modules/async/lib/async.js:246:13
at iterate (/home/c/node_modules/async/lib/async.js:131:13)
at /home/c/node_modules/async/lib/async.js:142:25
at /home/c/node_modules/async/lib/async.js:248:17
at /home/c/src/meta.js:219:10
at /home/c/node_modules/async/lib/async.js:246:13
at iterate (/home/c/node_modules/async/lib/async.js:131:13)
at /home/c/node_modules/async/lib/async.js:142:25
at /home/c/node_modules/async/lib/async.js:248:17
Am I missing something here?
This is so many kinds of win! Awesome work!
Edit: Same issue as above.
Looks like @psychobunny used the wrong paths for the js scripts. For now you can run NodeBB in development mode with ./nodebb watch
or you can update to this https://github.com/designcreateplay/NodeBB/commit/c8e423e9cf86b74c15aa87d334f8dffc2c6e6074
https://github.com/psychobunny/nodebb-plugin-desktop-notifications/blob/master/library.js#L8
Those paths are not existing and when NodeBB tries to minimize them it crashes.
Full list of scripts that went into the minify code
[ '/home/baris/node-forum/public/vendor/jquery/js/jquery.js',
'/home/baris/node-forum/public/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js',
'/home/baris/node-forum/public/vendor/jquery/js/jquery.timeago.js',
'/home/baris/node-forum/public/vendor/jquery/js/jquery.form.js',
'/home/baris/node-forum/public/vendor/bootstrap/js/bootstrap.min.js',
'/home/baris/node-forum/public/vendor/requirejs/require.js',
'/home/baris/node-forum/public/vendor/bootbox/bootbox.min.js',
'/home/baris/node-forum/public/vendor/tinycon/tinycon.js',
'/home/baris/node-forum/public/src/app.js',
'/home/baris/node-forum/public/src/templates.js',
'/home/baris/node-forum/public/src/ajaxify.js',
'/home/baris/node-forum/public/src/translator.js',
'/home/baris/node-forum/public/src/utils.js',
'/home/baris/node-forum/public/plugins/nodebb-plugin-desktop-notifications/vendor/notify/notify.js',
'/home/baris/node-forum/public/plugins/nodebb-plugin-desktop-notifications/lib/main.js' ]
hey, good catch. there was an bug with minification that used the plugin's virtual static directory and not its physical directory in node_modules.
Updating to this commit will solve your issue
https://github.com/designcreateplay/NodeBB/commit/5db27a835f3293ca8b3fd7efc0c63fe11af82b0a
That fixed most of the issues. Chrome asked me to confirm adding the ability to have desktop notifications for my site. Now when I should be getting a notification popup i get an error in console Uncaught TypeError: Cannot read property 'text' of undefined
Do you have the line number @cani? Try running in development mode so you can get the exact line number.
do you know what notification specifically that was? in any case run npm update
, I just added a catch to make sure that we don't show notifications that didn't have any text (for whatever reason)
@baris it's line 14 of nodebb-plugin-desktop-notifications/lib/main.js
@psychobunny just a reply to a thread with the text @cani asdf
try npm update
and lemme know if it works (version 0.0.6)
push notifications in mobile works only on firefox mobile, haven't tested chrome mobile.
I must be doing something wrong, same error just like 24 now
if (data.text) {
oh I get it. you need to update nodebb to this commit at minimum:
https://github.com/designcreateplay/NodeBB/commit/5db27a835f3293ca8b3fd7efc0c63fe11af82b0a
here's what's blocking you:
https://github.com/designcreateplay/NodeBB/commit/dc4aeca4278cbd2b30aff9bb1a3ed12334676149
that's why data is undefined
That did the trick, Thank you!
np, I should have realized. you might have noticed its been activated on the community forum as well
i see.
@psychobunny I wanna ask something on mobile. Does it work with safari on iOS? also, i just tried on chrome does not seems to work.
@quahfamili you may have to clear your browser cache to see it