Search code examples
electroncross-platformdesktop-application

Electron app notification states the app sending notification is electron.app.<App Name> even after packaging


After making a basic CPU Monitor app (https://drive.google.com/drive/folders/1f5yGQc4LFGj2baEjyHl5TT_LD5kM09uZ?usp=sharing) which sends notification when the cpu utilization goes over a certain percentage, I packaged the project. But the notification states that the app creating the notification is electron.app.CPU Monitor in place of CPU Monitor. How to exclude the unnecessary electron.app part?

notification screenshot


Solution

  • This appears to have been answered recently: how can you overwrite or remove the signature “electron.app.Electron” from the desktop notification

    On Windows, it seems that app.setAppUserModelId() must be called beforehand:

    if (process.platform === 'win32')
    {
        app.setAppUserModelId(app.name)
    }