Last active
September 1, 2017 21:51
-
-
Save BrandonSmith/f40776b8698ae8f9e17a080a2243118f to your computer and use it in GitHub Desktop.
Reply sometimes does not work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {app,Notification} = require('electron') | |
app.on('ready', () => { | |
showNextNotification() | |
}) | |
let i = 0 | |
showNextNotification = () => { | |
const notification = new Notification({ | |
title: 'Tester', | |
body: 'Does reply work this time?', | |
hasReply: true | |
}) | |
// A reply was submitted | |
notification.on(`reply`, (_, text) => { | |
console.log(`reply ${text}`) | |
showNextNotification() | |
}) | |
// Notification was clicked | |
notification.on(`click`, () => { | |
console.log(`click`) | |
}) | |
notification.on(`action`, (_, index) => { | |
console.log(`action ${index}`) | |
}) | |
notification.on(`show`, () => { | |
console.log(`show`) | |
}) | |
notification.on(`close`, () => { | |
console.log(`close`) | |
showNextNotification() | |
}) | |
notification.show() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment