|
@@ -55,18 +55,17 @@ Starting with a working application from the
|
|
|
```javascript fiddle='docs/fiddles/features/notifications/main'
|
|
|
const { Notification } = require('electron')
|
|
|
|
|
|
+const NOTIFICATION_TITLE = 'Basic Notification'
|
|
|
+const NOTIFICATION_BODY = 'Notification from the Main process'
|
|
|
+
|
|
|
function showNotification () {
|
|
|
- const notification = {
|
|
|
- title: 'Basic Notification',
|
|
|
- body: 'Notification from the Main process'
|
|
|
- }
|
|
|
- new Notification(notification).show()
|
|
|
+ new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
|
|
|
}
|
|
|
|
|
|
app.whenReady().then(createWindow).then(showNotification)
|
|
|
```
|
|
|
|
|
|
-After launching the Electron application, you should see the notification:
|
|
|
+After launching the Electron application, you should see the system notification:
|
|
|
|
|
|

|
|
|
|