Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement desktop notifications [$100 awarded] #27

Closed
zcbenz opened this issue Aug 26, 2012 · 111 comments
Closed

Implement desktop notifications [$100 awarded] #27

zcbenz opened this issue Aug 26, 2012 · 111 comments

Comments

@zcbenz
Copy link
Contributor

zcbenz commented Aug 26, 2012

webkitNotifications can be implemented by overriding ShowDesktopNotification and CancelDesktopNotification in content browser client, chrome has already implemented them in chrome/browser/notifications, code can be reused there.

The $100 bounty on this issue has been claimed at Bountysource.

@Mithgol
Copy link
Contributor

Mithgol commented Dec 22, 2012

Hyperlinks for the future docs on this feature:

@Mithgol
Copy link
Contributor

Mithgol commented Dec 26, 2012

And somebody should tell that user to watch this issue.

@AndryBray
Copy link

Hi! Any news about this feature? Hope yes =)

@ChaitanyaPramod
Copy link

Desktop Notifications are very critical for any App to give a completely native experience. And for a chat app (which I'm trying to port from a chrome-extension), notifications are essential.
I wonder if anyone has tried the implementation suggested by @zcbenz in the description? If it looks simple enough, I might try it.

@katanacrimson
Copy link

+1

2 similar comments
@AndryBray
Copy link

+1

@Anonyfox
Copy link

+1

@luxueyan2008
Copy link

me too

@YurySolovyov
Copy link

im not sure, but chrome 28+ should have notifications http://blog.chromium.org/2013/05/rich-notifications-in-chrome.html

@katanacrimson
Copy link

prior versions of chrome had it buried too under chrome://flags

@Mithgol
Copy link
Contributor

Mithgol commented Jun 24, 2013

I wonder if it does really mean that they appear then in Chromium/Blink code and then in node-webkit.

@AndryBray
Copy link

Please, could we know the place / priority of this feature in the roadmap?
Thank you

@Mithgol
Copy link
Contributor

Mithgol commented Jun 28, 2013

@Dream707

im not sure, but chrome 28+ should have notifications http://blog.chromium.org/2013/05/rich-notifications-in-chrome.html

That's rich notifications for Chrome packaged apps and extensions. A different thing.

Here we are talking about HTML5 Notifications API.

The real issue here is that typeof Notification === 'function' already (in node-webkit 0.6.1) and that you can call new Notification('some test'), but nothing happens.

@YurySolovyov
Copy link

maybe just a flag somewhere in build config or something? or some permission issues(you have to ask a permission in order to display notification)

@rogerwang
Copy link
Member

Hello, thanks for your patience.

The reason this feature is in Chromium but not in node-webkit is: The feature is implemented in the Chromium browser, which is built on Content Layer, on which is node-webkit built. (node-webkit is on the same level with the browser part of Chromium.) So code for this is not in node-webkit.

I planed to move it to node-webkit but recently it's under refactoring to a new component (message center) in upstream. The good news is that the new component is more Content Layer friendly so it would make the move easier. Now the plan is to provide this feature in node-webkit 0.7.x or 0.8.x if upstream makes it ready on all the 3 platforms.

@Mithgol
Copy link
Contributor

Mithgol commented Jun 30, 2013

Thank you for explaining the current state of things.

@miklschmidt
Copy link

That sounds great @rogerwang thanks for the update!

@katanacrimson
Copy link

Please keep us posted - I guess we'll have to individually work around this and come up with some sort of temporary solution on our own.

For linux, at least, we've got notify-send.

@miklschmidt
Copy link

My extremely dependency heavy take at a workaround is here: https://gist.github.com/miklschmidt/5896306 if it's useful to anyone.

@katanacrimson
Copy link

@miklschmidt That's quite helpful, thanks! I'll probably have to pick it over myself to make it a bit more agnostic, but that is a great start.

I take it vendor/tween is tween.js?

Also - what is lib/gui?

@miklschmidt
Copy link

tween.js is TWEEN.js https://github.com/sole/tween.js/

lib/gui is just a require.js wrapper for require('nw.gui') i like to avoid using two types of dependency declarations in the same file :)

@vlados
Copy link

vlados commented Aug 18, 2013

How we can help so this can be integrated as soon as possible?

@mbrevda
Copy link

mbrevda commented Aug 26, 2013

+1

@jtg-gg
Copy link
Member

jtg-gg commented Sep 3, 2014

I agree with you @jamesmortensen, I've made a pull request #2289

@victorzimmer
Copy link

+1

@adam-lynch
Copy link

Closed? Sorry, maybe I'm wrong, but are you settling for those tray tooltips on Windows?
image

IMO, they're not a good enough. Doesn't look like a real notification, can't show more than one at once, Windows is moving towards a different style notification since Windows 8, etc.

@edjafarov
Copy link

Just published replacement for rich desktop notifications check live -http://screencast.com/t/bUxB6vNvW8BN

https://github.com/edjafarov/node-webkit-desktop-notification
html5 Notification like API, better animations.

yoshuawuyts added a commit to yoshuawuyts/node-webkit-builder that referenced this issue Sep 19, 2014
Fixes an issue with node-webkit notifications -- nwjs/nw.js#27 (comment)
@edjafarov
Copy link

html5 notification ubuntu
screen shot 2014-09-20 at 8 33 33 pm

@J-Rojas
Copy link

J-Rojas commented Sep 26, 2014

Hello, I've tried node-webkit v0.10.5 on Windows 7 (64 bit), Service Pack 1. When trying to create a new Notification, node-webkit crashed. This occurred with both a local script bundled into the application and also in an IFrame. Notifications on MacOSX and Ubuntu both worked.

If someone has had success on Windows 7, can you share what version of the OS and version of node-webkit worked for you. Thanks.

@sergiopvilar
Copy link

@joshleaves @jamesmortensen @jtg-gg this works fine! Thanks!

adam-lynch pushed a commit to nwutils/nw-builder that referenced this issue Oct 29, 2014
Fixes an issue with node-webkit notifications -- nwjs/nw.js#27 (comment)
@rogerwang rogerwang changed the title Implement desktop notifications [$100] Implement desktop notifications Dec 15, 2014
@rogerwang rogerwang changed the title Implement desktop notifications Implement desktop notifications [$100 awarded] Feb 21, 2015
@marbemac
Copy link

Like @J-Rojas, I'm also seeing a crash in Windows 7 64 bit. The notifications are working fine in OS X and Linux. Does anybody have notifications working in Windows 7 (I have not tried other windows version yet)?

@jtg-gg
Copy link
Member

jtg-gg commented Feb 24, 2015

@marbemac I've just tested the latest build, it works on my win 7 64 bit, hmm do you have the call stack for the crash ?

@marbemac
Copy link

@jtg-gg I checked the %TEMP% folder for the crash dump as described here https://github.com/nwjs/nw.js/wiki/Crash-dump but don't see anything. Is there somewhere else I should be looking?

When it crashes Windows only gives me a "programName.exe has stopped working. a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."

I took the notification code out to make sure, and sure enough the app booted fine. Then, in the dev console, I created a new notification while the app was running and it crashed.

@marbemac
Copy link

@jtg-gg I was able get the .dmp file. See this paste bin:

http://pastebin.com/869PPRku

Looks like something to do with storage.get?

[3664:0223/190703:FATAL:image.cc(748)] Check failed: storage_.get().

The code I'm using for the notification is just

new Notification("Title", {body: "Body"});

Thanks in advance for any help you can provide!

@jtg-gg
Copy link
Member

jtg-gg commented Feb 24, 2015

@marbemac looks like, there is problem of getting the application icon, the notification, will try to get the application icon, if no image is specified

@victorzimmer
Copy link

If it works on OSX and Linux, but not Windows with fetching an image from the file tree it sounds a lot like a path error :P


Victor Zimmer

On Tue, Feb 24, 2015 at 5:46 AM, jtg-gg notifications@github.com wrote:

@marbemac looks like, there is problem of getting the application icon, the notification, will try to get the application icon, if no image is specified

Reply to this email directly or view it on GitHub:
#27 (comment)

@marbemac
Copy link

Hmm, where should I set this application icon? Is it required? If it makes any difference, I'm currently using https://github.com/mllrsohn/node-webkit-builder to build the app.

@marbemac
Copy link

@victorzimmer @jtg-gg I set the winIco option in node-webkit-builder but no luck - still crashes. Any other ideas? Do Windows 7 (64) notifications work for you guys when you build with node-webkit-builder (just to rule that out)?

@jtg-gg
Copy link
Member

jtg-gg commented Feb 25, 2015

@marbemac can you try, to specify some jpg/png icon (http:// or file://) when you execute the notification ?

@marbemac
Copy link

@jtg-gg I updated my notification code test to the below, and it works fine in OS X, but still crashes in Windows. Any other ideas? And it's working in Windows 7 for you? This is so weird. Incidentally I did try it on another windows 7 computer and it crashed on that one as well. I've also tried several of the packaging methods listed in the wiki.

var options = {
        icon: "http://www.fnordware.com/superpng/pngtest16rgba.png",
        body: "Here is the notification text"
};

var notification = new Notification("Notification Title", options);

@marbemac
Copy link

Ok so the example here worked:
https://github.com/nwjs/nw.js/tree/master/tests/manual_tests/notification

Investigating..

@marbemac
Copy link

Solved, my manifest file had the window.icon set to a blank string. So many places to set an icon, I didn't notice that option in the manifest file. Thanks for the help guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests