nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

Native Notification on Windows 10 Action center not works as expect

Open deltapath-eric opened this issue 8 years ago • 18 comments

https://bugs.chromium.org/p/chromium/issues/detail?id=734095&desc=3

base on the above change in chromium if I understand correctly, the chrome should already support the Native Notification on Windows 10 Action center

I just have a quick test on nwjs-sdk-v0.33.4-win-x64.zip And I discover that the native notification on Windows 10 is not showing (not under the Action Center). It will still show the chrome style notification.

provided the following demo index.html

  • beside the jsfiddle, you can also test with this url to generate a notification
  • https://tests.peter.sh/notification-generator/
<!DOCTYPE html>
<html>
  <head>
    <title>Hello World!</title>
    <script>window.location = 'https://jsfiddle.net/yoshi6jp/Umc9A/';</script>
    </head>
  <body>
    <h1>Hello World!</h1>
    We are using node.js <script>document.write(process.version)</script>.
  </body>
</html>

and package.json

{
  "name": "nw-demo",
  "version": "0.0.1",
  "main": "index.html"
}

Thanks so much.

deltapath-eric avatar Oct 10 '18 02:10 deltapath-eric

I have noticed this in my native application as well as in the test application above.

betsonserviceportal avatar Oct 15 '18 11:10 betsonserviceportal

Thanks for reporting. Will look to fix it.

Yes, the code from upstream is there. But it's broken because of the missing registry entry and shortcut link, which is supposed to be handled during application installation. Will find a way to enable them.

rogerwang avatar Oct 16 '18 07:10 rogerwang

Excuse my ignorance. Is this something I can grab and test? Thanks.

betsonserviceportal avatar Oct 17 '18 16:10 betsonserviceportal

Not for now. Will let you know. However proposals on how it will be done would be helpful:

The latest win10 requires that any application must have a shortcut in start menu so it would be allowed to show notifications. And to receive event when users interact with the notification, Chrome requires that an entry with application specific CLSID in the system registry should be set and pointed to the application exe. I'm trying to design an API for the shortcut creation, but any suggestions are welcome.

rogerwang avatar Oct 18 '18 00:10 rogerwang

Well we usually have an installer that takes care of the shortcut creation as well any registry settings. So that shouldn't be a problem and only needs to be documented.

Will the native Win10 notifications work out of the box after that? And starting from which NWJS version?

gpetrov avatar Oct 18 '18 06:10 gpetrov

It is still to be fixed in NW, as the current CLSID is builtin. Will let applications customize it via package.json or API call...

rogerwang avatar Oct 18 '18 06:10 rogerwang

btw, NW needs to know the AppUserModelID in the shortcut lnk file as well.

rogerwang avatar Oct 18 '18 06:10 rogerwang

This is our first dive into NW. We're only using NW to launch an Intranet page so that we can have more control over the browser window. We're handling the minimize and close events and placing our application in the system tray. We're just pushing out the NW folder and our app folder to the users computers and adding nw.js to the PATH. We're doing a redirect to an HTTPS page, so we found we need to get a certificate for that so that the notification itself shows. The notification showing up in the Action Center worked until a few weeks ago.

betsonserviceportal avatar Oct 18 '18 11:10 betsonserviceportal

Did they install the win10 fall creators update? The requirements on the shortcut is introduced in that update: https://stackoverflow.com/questions/46814858/toast-notification-not-working-on-windows-fall-creators-update

On Thu, Oct 18, 2018, 7:09 PM betsonserviceportal [email protected] wrote:

This is our first dive into NW. We're only using NW to launch an Intranet page so that we can have more control over the browser window. We're handling the minimize and close events and placing our application in the system tray. We're just pushing out the NW folder and our app folder to the users computers and adding nw.js to the PATH. We're doing a redirect to an HTTPS page, so we found we need to get a certificate for that so that the notification itself shows. The notification showing up in the Action Center worked until a few weeks ago.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/nwjs/nw.js/issues/6824#issuecomment-430968505, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKGGUU7qPszQR0n7WaBc4k2PxG0ali-ks5umGFWgaJpZM4XUcw8 .

rogerwang avatar Oct 18 '18 11:10 rogerwang

I don't see that update in my history.

betsonserviceportal avatar Oct 19 '18 16:10 betsonserviceportal

will the native Windows 10 notifications work in the 0.34.1? Or maybe the upcoming 0.34.2 - or will it take much longer @rogerwang ? We really would like to have them soon....

gpetrov avatar Oct 29 '18 15:10 gpetrov

It's being worked on and will take more efforts than 0.34.2.

rogerwang avatar Oct 30 '18 02:10 rogerwang

Base on the example at the top and tested v0.39.3 with Windows 10, still not able to make the notification under Windows 10 Action Center

  • which use the index.html and package.json at the top

deltapath-eric avatar Jul 26 '19 06:07 deltapath-eric

Base on the example at the top and tested v0.44.0 with Windows latest 10, still not able to make the notification under Windows 10 Action Center

  • which use the index.html and package.json at the top
  • also the https://tests.peter.sh/notification-generator/

deltapath-eric avatar Feb 09 '20 15:02 deltapath-eric

Base on the example at the top and tested v0.50.2 with Windows 10 Pro Version 2004, still not able to make the notification under Windows 10 Action Center

  • which use the index.html and package.json at the top
  • also the https://tests.peter.sh/notification-generator/

deltapath-eric avatar Dec 10 '20 01:12 deltapath-eric

Is somewhere docs, how use native win 10 noti center via NWjs?

panther7 avatar Mar 26 '21 12:03 panther7

Base on the example at the top and tested v0.54.1 with Windows 10 Pro Version 20H2, still not able to make the notification under Windows 10 Action Center

which use the index.html and package.json at the top also the https://tests.peter.sh/notification-generator/

deltapath-eric avatar Jul 21 '21 02:07 deltapath-eric

Nothing new to add here from my side, I do experience the same problem. Is there any release date preview for this?

monema75 avatar Sep 16 '21 14:09 monema75