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

Notification API do not work with Windows 10 16299.19 (fall creators update) #10864

Open
GregorBiswanger opened this Issue Oct 20, 2017 · 80 comments

Comments

Projects
None yet
@GregorBiswanger

GregorBiswanger commented Oct 20, 2017

  • Electron version: 1.7.8
  • Operating system: Windows 10 16299.19 - latest update

Expected behavior

Create a desktop notifications.

Actual behavior

No notification.

How to reproduce

Try with yours https://github.com/electron/electron-api-demos

@robinwassen

This comment has been minimized.

Contributor

robinwassen commented Oct 22, 2017

I am also able to reproduce this with the following setup:

  • Electron version: 1.8.1
  • Windows 10 16299.19
  • Electron API demo application - neither of the Basic notification or Notification with image appears on the desktop or notification center.

Looking at the build changes they have poked around in notifications: https://changewindows.org/build/16299/pc

Other applications has successfully shown notifications in Windows 10 16299.19, both Windows Defender and a third party app.

@MarshallOfSound

This comment has been minimized.

Member

MarshallOfSound commented Oct 22, 2017

For the record I've been on the fast insiders track all year and have never had this problem, I'm currently on 17017 and double checked, notifications still work perfectly fine.

I'd suggest y'all got a broke build in 16299, when you update out of that version I wouldn't be surprised if this starts working for you again.

@felixrieseberg

This comment has been minimized.

Member

felixrieseberg commented Oct 25, 2017

First of all, 👋 Gregor! Lange nicht mehr gesehen!

Secondly, the notification API in Windows 10 remained fundamentally the same, so this isn't gonna be easy. Action Center is pretty unreliable though - and apparently, as I learned from the notification team a few days ago, things can fall apart all the time. I can also confirm the bug on 16299.19, but I'd like to make double-sure that this isn't on Windows.

I'll take a look at this.

As a short-term solution, electron-windows-notifications still works fine.

@sidneys

This comment has been minimized.

Contributor

sidneys commented Nov 1, 2017

I can reproduce this, neither of my apps show notifications in Windows 10 17025.

@adlk

This comment has been minimized.

adlk commented Nov 2, 2017

Same here.

  • Win 10 Pro Version 1703 (Build 15063.674) notifications work fine by using window.Notification and electron-windows-notifications
  • Win 10 Enterprise Evalution Version 1709 (Build 16299.9) neither window.Notification nor electron-windows-notifications show notifications.

The second build is the official IE Testing VM already running the Fall Creators Update.

@felixrieseberg Is there something we can do to support you in any way?

@dustinsoftware

This comment has been minimized.

dustinsoftware commented Nov 2, 2017

Same, my app broke as well with Fall Creators update :(

@aspau

This comment has been minimized.

aspau commented Nov 8, 2017

Macrium Reflect team says the update has restricted the number of apps that can register for notifications (link below). Not sure if this is related but I can confirm that in addition to my Electron app being able to send notification on a pre-Fall Creators Update computer and not a post fall update computer, my app also no longer shows in the "Get notifications from these senders list" after updating whereas it did before.

https://knowledgebase.macrium.com/display/KNOW7/Windows+10+Notifications+-+1709+Fall+Creators+Update

@levinunnink

This comment has been minimized.

levinunnink commented Nov 8, 2017

Same problem here. Upgraded to the Fall Creators Update and no more notifications.

@qqj1228

This comment has been minimized.

qqj1228 commented Nov 9, 2017

I have the same issue.
Notifications can't work on Windows 10 16299.19, but works fine on Windows 10 15XXX.
Electron version is 1.7.9 and 1.7.6
So I use showMessageBox instead of Notifications

@levinunnink

This comment has been minimized.

levinunnink commented Nov 14, 2017

Can anyone confirm that switching to electron-windows-notifications fixes the issue?

@adlk

This comment has been minimized.

adlk commented Nov 14, 2017

@levinunnink at least not for me. I tried it directly with the nodeRT as well but without success (electron-windows-notification is built on nodeRT)

@levinunnink

This comment has been minimized.

levinunnink commented Nov 14, 2017

So right now there is no known way to get notifications working on Electron + Windows 10 16XXX? Seems like a major problem. It's certainly breaking my app big time. Is anyone working on this?

@aspau

This comment has been minimized.

aspau commented Nov 14, 2017

As a not very satisfying workaround, I'm using a modified version of electron-toaster for 16XXX+ computers right now which creates a new browser window that looks, acts, and appears/disappears like a notification. But it would be really good to get access to native notifications back.

@levinunnink

This comment has been minimized.

levinunnink commented Nov 22, 2017

I think I found a fix! Calling app.setAppUserModelId(<my app id>) suddenly fixes my notifications.

https://electronjs.org/docs/api/app#appsetappusermodelidid-windows

Can anyone else confirm that this fixes the issue? If this works for everyone, the documentation seriously needs to be updated.

@JimminiKin

This comment has been minimized.

JimminiKin commented Nov 23, 2017

@levinunnink setAppUserModelId Fixes the issue for me too, Thx !

@hacdias hacdias referenced this issue Nov 24, 2017

Merged

[WIP] Update Dependencies and make this work #511

5 of 5 tasks complete
@hacdias

This comment has been minimized.

hacdias commented Nov 26, 2017

Same issue here.

@felixrieseberg

This comment has been minimized.

Member

felixrieseberg commented Nov 26, 2017

Quick question: Which appUserModelId are you using to fix this? Electron already calls app.setAppUserModelId(com.squirrel.${packageName}.${exeName}), but only if your app was pacakged as a Squirrel app.

@levinunnink

This comment has been minimized.

levinunnink commented Nov 27, 2017

@felixrieseberg We ship our app using electron-packager, I don't think we use squirrel. The app id I used was the one in package.json build.appId.

@aspau

This comment has been minimized.

aspau commented Nov 28, 2017

That did it! Using app.setAppUserModelId and specifying the same id used in package.json got native notifications back up and running -- and the app also now shows up in the Windows "Notifications & actions" settings page. Thank you so much!

@MarshallOfSound

This comment has been minimized.

Member

MarshallOfSound commented Dec 4, 2017

Somewhat related: #11331

@abardik

This comment has been minimized.

abardik commented Dec 6, 2017

Thanks a lot! It works.

dustinsoftware added a commit to Faithlife/FaithlifeMessages that referenced this issue Dec 7, 2017

@m4heshd

This comment has been minimized.

m4heshd commented May 10, 2018

@roelpaulo when you execute an electron app on development it executes the electron.exe. So your process.execPath will point to that. That means you need to create a shortcut to electron.exe. Path would be <YOUR_PROJECT_DIR>\node_modules\electron\dist\electron.exe.

As an alternative you can use windows-shortcuts module to create a shortcut.

var ws = require('windows-shortcuts');
ws.create("%APPDATA%/Microsoft/Windows/Start Menu/Programs/Electron.lnk", process.execPath);
@roelpaulo

This comment has been minimized.

roelpaulo commented May 10, 2018

@m4heshd, Thanks, it's working now on development mode. It's really strange that it wouldn't work on mine when I did the drag-and-drop shortcut of electron dist on the start menu. Cheers bro 👍

@gotchane

This comment has been minimized.

gotchane commented May 15, 2018

I'm a new of electrion. I haven't solved this issue yet...

  • Electron: 1.7.11
  • Windows: 10.0.16299.431
  • Builder: electron-builder
  • Build target: squirrel

I use electron-builder to build a windows app installer.
I read this issue's discussion and do below, but notification doesn't work.

  1. set app.setAppUserModelId(${package.json build.appId}); to main.js
  2. set build.appId to package.json
  3. build an app by electron-builder
  4. check if notification is enabled

However, if I use NSIS by Build target instead of squirrel , notification works fine.
Does anyone know how to fix this?

@beica1

This comment has been minimized.

beica1 commented May 22, 2018

@samuelcarreira it's worked for me, thx for your share 💯

my env as follow:

  • electron: 1.8.4
  • win10: 1803(17134.48)
@damianobarbati

This comment has been minimized.

damianobarbati commented Jun 6, 2018

@Hubu this stopped working for me on my Windows 10 1803.
It was working until a couple hours ago and I didn't change a damn thing until now!

Is there some kind of behaviour of Windows 10 we should know about it?

@damianobarbati

This comment has been minimized.

damianobarbati commented Jun 8, 2018

Guys I solved this one using 1024x1024 .png images for your notifications on Windows.

No need for either app.setAppUserModelId or app.setAsDefaultProtocolClient, no matter Win7 or Win10.

And I'd like add: FOR F**K SAKE.

@develar if you could double check this and confirm it I'd suggest adding it to docs!

@m4heshd

This comment has been minimized.

m4heshd commented Jun 8, 2018

@damianobarbati nope. It doesn't work. Still the easiest way is app.setAppUserModelId(process.execPath);.

Windows - 17134
Electron - 2.0.0 and 1.8.x

@Cheney925

This comment has been minimized.

Cheney925 commented Jul 9, 2018

Guys I found it works with win10 1703(15063), but not with win10 1803(17134).
Maybe electron needs to update to fix with the new Windows version.

@m4heshd

This comment has been minimized.

m4heshd commented Jul 9, 2018

@Cheney925 i don't think there's a fix because it's simply a requirement set by Windows. No App ID and no shortcut? no notifications.

@Cheney925

This comment has been minimized.

Cheney925 commented Jul 9, 2018

@m4heshd I did the same with you.
app.setAppUserModelId(process.execPath)
Same Windows version and Electron version.
And I'm sure there is a shortcut.
SO WHY?

@m4heshd

This comment has been minimized.

m4heshd commented Jul 9, 2018

@Cheney925 is your app in development or production(packaged)? Also how did you create the shortcut?

@Cheney925

This comment has been minimized.

Cheney925 commented Jul 10, 2018

@m4heshd Sorry, it's a code error. Solved now, Thanks!

@Anrock

This comment has been minimized.

Contributor

Anrock commented Jul 10, 2018

Is it documented somewhere what changes are required to make notifications work?

@m4heshd

This comment has been minimized.

m4heshd commented Jul 10, 2018

@Anrock https://electronjs.org/docs/tutorial/notifications

If you want to try other options just read this thread from bottom to the top.

@rahulbm

This comment has been minimized.

rahulbm commented Jul 19, 2018

@levinunnink Thanks. But after setting app.setAppUserModelId(<my app id>) Notification doesn't stay in Action centre

@tzarebczan

This comment has been minimized.

tzarebczan commented Aug 3, 2018

Has anyone noticed that Electron app notifications block other windows notifications? I've seen cases when I close my electron app, I see other windows notifications pouring in.

scuy added a commit to scuy/idai-field that referenced this issue Aug 22, 2018

Change appId in package.json
Makes sure it is the same as one set with app.setAppUserModelId() and
hopefully fixes notifications under windows 10.

See: electron/electron#10864 (comment)

scuy added a commit to scuy/idai-field that referenced this issue Aug 28, 2018

Change appId in package.json
Makes sure it is the same as one set with app.setAppUserModelId() and
hopefully fixes notifications under windows 10.

See: electron/electron#10864 (comment)
@tonogueira2

This comment has been minimized.

tonogueira2 commented Sep 15, 2018

@felixrieseberg Nós enviamos nosso aplicativo usando electron-packager, eu não acho que nós usamos o esquilo. O ID do aplicativo que usei era o que estava em package.json build.appId.

nice... thks.....

@icssjs

This comment has been minimized.

icssjs commented Oct 25, 2018

windows 10

  1. add node_modules\electron\dist\electron.exe to Start Menu
  2. main.js add app.setAppUserModelId(process.execPath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment