

Important note : electron by itself (latest build), offer you the Notification API which send a simple notification (the same way that node-notifier does) in the operative system. After a succesfully installation, you'll access the notifier using require('node-notifier'). Visit the official repository of the project here.
#Node js mac notifications install#
To achieve our goal, we are going to use the node-notifier library which can be downloaded in your project using the following command : npm install -save node-notifier If none of these requirements are met, Growl is used.

Using Notification Center for Mac, notify-osd/libnotify-bin for Linux, Toasters for Windows 8/10, or taskbar Balloons for earlier Windows versions. Node notifier is a Node.js module for sending cross platform system notifications. It works with Linux and MacOS, however it doesn't has the same native feel and look, therefore we recomend you to use the node-notifier plugin with your Electron app. You can use this API with electron too, however it isn't available for windows. Probably you'll may be asking to yourself : why don't use the webkitNotification API ?. You may want to be careful how often you show this messages to the user and ask for the permission to do this as the excessive use of native notifications can be annoying and irritating. That's why we'll need to access the notification system of the OS, which allow you to send a message to the user in the screen in any situation although they were using another app.īut remember, everything in excess is bad.

Fancy notification can be created within the window of your app, however sometimes you may want to notify something to your user, even if it isn't using the app in first plain or is minimized. Thanks to webkit, you're able to customize with CSS the UI of your application as you wish.
