how can you overwrite or remove the signature “electron.app.Electron” from the desktop notification

不打扰是莪最后的温柔 提交于 2021-02-04 21:05:37

问题


I'm trying to remove or overwrite my notification signature made by electron.

here is what i get:

I am trying to whether overwrite the signature electron.app.Electron or remove it completely, by knowing that I have tested it on test mode (npm run start), and also when packed as .exe also I have noticed that I remove the icon the signature goes a way, but it is very unpleasant without one.

my current notification code is bellow:

function showNotification() {
  const notification = new Notification("new message", {
    body: "app launched",
    icon: __dirname + '/icon.ico',
    tag: 'soManyNotification',
    hasReply: true
  })
}
console.log(Notification.permission)
if (Notification.permission === "granted") {
  showNotification()
  //alert('we have permission');
} else if (Notification.permission === "denied") {
  Notification.requestPermission()
};

any help would be gratefully appreciated ^^


回答1:


// If this is running on Windows then set UserModelID for notification

if (isWin()) {
    app.setAppUserModelId("Proper name to be replaced");
}


来源:https://stackoverflow.com/questions/64088839/how-can-you-overwrite-or-remove-the-signature-electron-app-electron-from-the-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!