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

0.13: Native desktop notifications #4560

Closed
bastimeyer opened this issue Mar 13, 2016 · 26 comments
Closed

0.13: Native desktop notifications #4560

bastimeyer opened this issue Mar 13, 2016 · 26 comments

Comments

@bastimeyer
Copy link

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
Copy link
Member

Will see this after 0.13.0.

This should be done via Node.js module btw.

@bastimeyer
Copy link
Author

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
Copy link
Member

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
Copy link

arudnev commented Mar 23, 2016

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
Copy link
Member

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
Copy link

arudnev commented Apr 19, 2016

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
Copy link

zdol commented Apr 20, 2016

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

@shripathee
Copy link

+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
Copy link

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

@Sytten
Copy link

Sytten commented Jun 3, 2016

Would like to see that happen too...

@shripathee
Copy link

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
Copy link
Member

@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
Copy link
Author

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... 😞

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! 😃
Thank you!

@cassiodoroVicinetti
Copy link

+1 for native notifications

@shripathee
Copy link

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

@Saravanan90
Copy link

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

@rogerwang
Copy link
Member

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
Copy link
Author

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
Copy link
Author

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
Copy link

fritx commented Dec 14, 2016

+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
Copy link

fritx commented Mar 23, 2017

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

@rogerwang
Copy link
Member

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

@fritx
Copy link

fritx commented Apr 19, 2017

@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
Copy link

@mohammedgqudah
Copy link

any updates on how to do this in 2017? i really need to know

@razor-4eg
Copy link

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

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

No branches or pull requests