Note: Announcing Quark appstore. Discover and share Quark projects and all the best community-made resources. ⚡
Visit
Dismiss

Electron

Electron is a framework for creating native applications with web technologies like JavaScript, HTML, and CSS. This guide describes how you can use electron in your projects.

Using the electron's renderer process api.

In your sketches you have access to all of the electron's renderer process API's. Let's see how we can use the notifications api in your sketches.

// setup.js
import { remote } from 'electron';
import * as path from 'path';

// notificationWithImage
const notificationWithImage = new remote.Notification({
    title: 'Notification with image',
    body: 'Short message plus a custom image',
    icon: path.join(remote.app.getAppPath(), '/appAssets/32x32.png')
});

notificationWithImage.addListener('click', (e, i) => {
    console.log('Notification clicked');
});
notificationWithImage.show();



// notificationWithoutImage
const notificationWithoutImage = new remote.Notification({
    title: 'Basic notification',
    body: 'Short message'
});

notificationWithoutImage.addListener('click', (e, i) => {
    console.log('Notification clicked');
});
notificationWithoutImage.show();
Last Updated: 7/16/2019, 1:27:44 PM
MIT Licensed | Copyright © 2019-present Nishkal Kashyap