electron-archive/brightray

Desktop notifications do not work on Windows 8.1

miniak opened this issue · 0 comments

NotificationPresenterWin::ShowNotification contructs the WindowsToastNotification object with GetApplicationName(), which is implemented like this:

std::string GetApplicationName() {
  auto module = GetModuleHandle(nullptr);
  auto info = make_scoped_ptr(
      FileVersionInfo::CreateFileVersionInfoForModule(module));
  return base::UTF16ToUTF8(info->product_name());
}

The appId value gets passed to IToastNotificationManager::CreateToastNotifierWithId.
The get the correct value, GetCurrentProcessExplicitAppUserModelID has to be called instead of GetApplicationName.

On Windows 8.1, the appId has to match the application shortcut in the Start Menu, which it therefore does not match.