Reputation: 3089
I am trying to initialize an object of Notification provided by electron. But I am getting the error as:
Uncaught Exception:
TypeError: electron.Notification is not a constructor
I am doing this in Main
process.
Code:
const electron = require('electron');
new electron.Notification({ title: "Cue", body: "Hello" }).show();
Electron version: 2.0.2/2.0.3
Any clues or ideas?
Upvotes: 5
Views: 3592
Reputation: 123
I think you should write
new electron.remote.Notification({....})
instead of
new electron.Notification({....})
Upvotes: 8