【问题标题】:Windows: Electron notifications not showing the app logo but everywhere else it doesWindows:电子通知不显示应用程序徽标,但在其他地方显示
【发布时间】:2022-11-10 09:08:35
【问题描述】:

应用程序徽标在其他任何地方都正确显示,但在显示空徽标的通知部分

我知道您可以为通过icon 属性的通知添加自定义图像,如下所示:

           new Notification({
              title: 'Test Notification',
              body: 'This is a test notification',
              icon: path.join(__dirname, 'icon.png'),
            });

但这不是我想要改变的标志。

该应用程序在构建时还会在其他地方显示正确的徽标:

在创建BrowserWindow 时,我还添加了icon 属性,就像建议的here 一样。

  splashWindow = new BrowserWindow({
    width: 320,
    height: 320,
    // more 
    icon: path.resolve(__dirname, 'icon.png'),
  });

我已经能够通过setAppUserModelId 将应用名称修改为“Awesome App”,如下所示:

ipcMain.on('app-ready', () => {
  if (process.platform === 'win32') {
    // somehow also change logo here? can't find it in the docs
    app.setAppUserModelId('Awesome app');
  }

这段代码都在main.js

我一直在检查the docs for the App class,有一个getFileIcon,但它似乎与此无关。

【问题讨论】:

    标签: electron electron-builder


    【解决方案1】:

    同样的问题,尝试设置徽章网址,但不起作用

    【讨论】:

      猜你喜欢
      • 2019-04-22
      • 2020-08-13
      • 1970-01-01
      • 2017-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-10
      相关资源
      最近更新 更多