Notifications
Renderer
function Notify() {
function notify() {
const myNotification = new window.Notification("HI", { body: "THERE" });
}
return <button onClick={notify}>Notify</button>;
}Main
function callUpdateNotification() {
const iconAddress = `file://${__dirname}/assets/logo.png`;
const notifOptions = {
title: "Slingshow",
subtitle: "NOW",
body: "Time to update your team (⌘K)",
icon: iconAddress
};
const notif = new Notification(notifOptions);
notif.show();
notif.addListener("click", e => {
console.log("I hear the shit out of you");
});
}Last updated