electron-windows-notifications
electron-windows-notifications copied to clipboard
Plugin not working in Angular apps: You tried to use electron-windows-notifications, but you're not running Windows 10, 8.1, or 8
Hi,
we tried to use this plugin in an Angular app packaged using Electron. When trying to use notifications, I received this warning:
You tried to use electron-windows-notifications, but you're not running Windows 10, 8.1, or 8. No operations will be performed.
This is because Angular also declares a global variable "process". In this line, the process variable is the Angular one, not the Node one, so process.platform is undefined and it thinks the environment isn't Windows.
I was able to fix this by adding this line to the start of index.js:
const process = require('process')
I'm not sure if this is the best approach to fix the issue, so I prefer opening an issue instead of sending a PR.