Search code examples
node.jsnotificationselectronchromium

How to change the title in an Electron Notification?


Now I'm making windows app by using ElectronJS. After packaging app, I tested app.

But the title of notification is "Electron". How can I set the title of notification to my app name?


Solution

  • Notifications says all about it.

    From main process

    new Notification({
      title: 'My Title',
      body: 'Lorem Ipsum Dolor Sit Amet'
    })
    

    From renderer process

    new Notification('My Title', {
      body: 'Lorem Ipsum Dolor Sit Amet'
    })