首页 > 解决方案 > 如何从桌面通知中覆盖或删除签名“electron.app.Electron”

问题描述

我正在尝试删除或覆盖我由电子制作的通知签名。

这是我得到的:
在此处输入图像描述

我正在尝试覆盖签名electron.app.Electron还是完全删除它npm run start,因为我知道我已经在测试模式 ( .exe,但没有一个是非常不愉快的。

我当前的通知代码如下:

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()
};

任何帮助将不胜感激^^

标签: javascriptnode.jsnotificationselectronelectron-forge

解决方案


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

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

推荐阅读