nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.4k stars 3.88k forks source link

0.13: Native desktop notifications #4560

Closed bastimeyer closed 8 years ago

bastimeyer commented 8 years ago

NW.js 0.13 now comes with Chromium's rich notifications. Those are non-native and may be annoying for users who'd rather prefer using the notification system of their OS (Linux, OSX, Win10).

Would it be possible to add native notifications used by the previous releases back, alongside the new rich notifications? Both new window.Notification() and chrome.notifications.create() could still create rich notifications, but having access to native notifications somewhere in NW.js' API would be great. This way, the notification could be manipulated by the chrome.notificationProvider API.

Thank you!

rogerwang commented 8 years ago

Will see this after 0.13.0.

This should be done via Node.js module btw.

bastimeyer commented 8 years ago

This should be done via Node.js module

As far as I know, there are no node modules available that provide native desktop notification support for all platforms at the same time. Some of them are exclusively using libnotify, growl or are simply OSX specific. Finding a solution with multiple node modules would be a dependency nightmare, if it's even possible to find fitting modules for all platforms.

One of the best features of NW.js are the native desktop notifications and many devs are reliant on this, so why would you want to remove it? Also from what it looks like, the nw_notification_manager is still being included in the nw13 builds, isn't it?

I'm very much looking forward to nw13, but not having support for native desktop notifications is going to annoy many devs and users. This is one of the key features of my application at least and I need to upgrade to nw13 as soon as possible, because it fixes some crucial memory leaks that are caused by 0.12.x. But not being able to create native notifications is pretty much a no-go for me. I think many devs are in the same situation like I am.

rogerwang commented 8 years ago

I'm not saying you should use existing Node.js modules -- if we're going to support this, we'll do it with Node.js module. There is no reason not to do it in this way.

arudnev commented 8 years ago

Are there any known open issues with the https://github.com/mikaelbr/node-notifier and nw13 that would prevent using this combination for support of native notifications and Growl fallback? I can see how next release of our app will prompt questions about the switch from native notifications and requests to support it, but I was thinking about simply adding an adapter on application level to allow easy switch between W3C Web Notifications, Chrome Notifications and something like node-notifier. Are there any good reasons to develop NW.js specific node module for support of native notification managers?

rogerwang commented 8 years ago

With upstream supporting native notifications on OSX, NW will support this out of the box:

https://bugs.chromium.org/p/chromium/issues/detail?id=326539

We tend to support both rich notification and native notification as users prefer different options.

arudnev commented 8 years ago

Is it available in nw14 already? How can it be enabled? It does not look like there is anything similar for Windows or any near term plans for that. Also, it looks like onclick event is not supported in chromium implementation yet. It seems that integration of W3C Notification API with native notification managers that was implemented in nw12 worked better in most cases than the one included in nw13, as new implementation often results in overlap of native and NW.js notifications, plus no way to control Do Not Disturb, lock screen and other notifications settings. I don't know how difficult it would be to port implementation from nw12 and make it available via some switch or a module, but I'm sure most of developers would prefer to use that as a default.

zdol commented 8 years ago

+1 for native notifications as in nw12. They look so weird now, at least on OS X.

shripathee commented 8 years ago

+1 for native notifications. Chromium notifications are not displayed in fullscreen mode in OSX - https://bugs.chromium.org/p/chromium/issues/detail?id=316281. This issue is preventing us from switching to Chromium's rich notifications.

razor-4eg commented 8 years ago

Any news? We need to update from 0.12, but this ugly chrome notifications are stopping us.

Sytten commented 8 years ago

Would like to see that happen too...

shripathee commented 8 years ago

Tried running NW v0.16.0-beta1 with the enable-native-notifications flag, but still seeing Chromium notifications. However, Chrome (stable) currently supports native OSX notifications under the flag.

rogerwang commented 8 years ago

@shripathee good to know it. Will check this soon after beta1 release, which is scheduled today. At least NW will support whatever Chromium supports.

bastimeyer commented 8 years ago

Nice to see some movement here. It would be great though, if the focus would not only be on OSX. Relying on the internal implementation of Chromium (I know that's the only platform the Chromium devs are working on) and ignoring Linux and Windows can not be the goal. It's not just about the look and feel of the "ugly" chromium notifications like others are calling it here. It's about being able to control native desktop notifications with your system and not having a secondary, non-native notification manager.

The upgrade of my application to NWjs>=0.13.0 is still blocked by the lack of native desktop notifications. Shipping a version that only supports OSX is a no-go for me. Including node-notifier and its multiple third-party binaries plus other dependencies is also not an option. This sadly means that I still have to use v0.12.3 with its broken garbage collector (crucial reason for upgrading) and old Chromium (41) and Node.js (1.2.0) versions... :disappointed:

I don't exactly know what you mean by looking into this after the 0.16.0-beta.1 release, but I hope you mean solving this issue for all platforms. That would be awesome! :smiley: Thank you!

cassiodoroVicinetti commented 8 years ago

+1 for native notifications

shripathee commented 8 years ago

I just tested in NWjs v0.17.0-beta1 and it's still creating Chrome notifications, even with the flag 😞

Saravanan90 commented 8 years ago

Native notifications got displayed with the NWjs v0.16.1 stable with '--enable-native-notifications' set in 'chromium-args' in package.json

rogerwang commented 8 years ago

As Chromium upstream is developing native notification and our plan is to use their work, I'm closing this issue. Please watch and star the upstream issues to increase the priority there:

https://bugs.chromium.org/p/chromium/issues/detail?id=326539

bastimeyer commented 8 years ago

The current chromium canary does only support OSX...

Windows 10 action center support is being worked on, though: https://bugs.chromium.org/p/chromium/issues/detail?id=516147

There are still no comments about support for Linux: https://bugs.chromium.org/p/chromium/issues/detail?id=472080

bastimeyer commented 8 years ago

Is there a way to disable the settings button of native notifications on MacOS? (using the --enable-native-notifications parameter)

Clicking the settings button opens up a new window with a blank page and a blank address bar.

When using chrome/chromium on MacOS, clicking the settings button opens chrome://settings/contentExceptions#notifications in a new tab.

fritx commented 7 years ago

+1 seems like currently we have only simple APIs like .onclick, .onclose (https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification).

would be great if we have something like .onShowSettings mentioned in https://developer.chrome.com/apps/notifications#event-onShowSettings

I'm using nw 0.18.8-sdk. Hope that is not another upstream problem that nw can't handle.

fritx commented 7 years ago

--enable-native-notifications doesn't work when I upgraded to nw21 from nw18 😢

rogerwang commented 7 years ago

@fritx could you please try --enable-features=NativeNotifications ?

fritx commented 7 years ago

@rogerwang cool, but where could I find it in the latest docs? Btw, I didn't solved the problem and switched to node-notifier#71.

I haven't yet tried --enable-features=NativeNotifications, but the older --enable-native-notifications had the settings bug: , that's why I had to try that node module.

deltapath-eric commented 7 years ago

https://developers.google.com/web/updates/2017/04/native-mac-os-notifications?utm_source=feed&utm_medium=feed&utm_campaign=updates_feed

FYI, this should be nearly able to done without any packages on Mac OS X

razor-4eg commented 6 years ago

mikeGHQ update of what? It's closed already, chromium use native notification from last summer.