Use NotificationPresenter - macOS

This commit is contained in:
Samuel Attard 2017-05-29 20:02:33 +10:00
parent 193c561815
commit 058bdfbced
17 changed files with 93 additions and 80 deletions

View file

@ -1,4 +1,4 @@
const {app, BrowserWindow} = require('electron')
const {app, BrowserWindow, Notification} = require('electron')
const path = require('path')
let mainWindow = null
@ -27,5 +27,14 @@ exports.load = (appUrl) => {
mainWindow = new BrowserWindow(options)
mainWindow.loadURL(appUrl)
mainWindow.focus()
const n = new Notification({
title: 'Foo',
body: 'Bar',
hasReply: true,
replyPlaceholder: 'foo'
});
n.on('reply', (...args) => console.log(args));
n.show();
})
}