From 6b20f915b9697303e17b5aa3d54ebc5b8ba4f80c Mon Sep 17 00:00:00 2001
From: Chris Knepper <chris82thekid@gmail.com>
Date: Fri, 22 Jun 2018 00:00:55 -0400
Subject: [PATCH] -Allow notifications on Windows

---
 src/background.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/background.js b/src/background.js
index 70942f53..584d74dc 100644
--- a/src/background.js
+++ b/src/background.js
@@ -11,6 +11,7 @@ import { baseMenuTemplate } from './menu/base_menu_template';
 import { devMenuTemplate } from './menu/dev_menu_template';
 import { helpMenuTemplate } from './menu/help_menu_template';
 import createWindow from './helpers/window';
+import { IS_WINDOWS } from './constants';
 
 // Special module holding environment variables which you declared
 // in config/env_xxx.json file.
@@ -33,6 +34,13 @@ if (env.name !== 'production') {
   app.setPath('userData', `${userDataPath} (${env.name})`);
 }
 
+if (IS_WINDOWS) {
+  // Stupid, DUMB calls that have to be made to let notifications come through on Windows (only Windows 10?)
+  // See: https://github.com/electron/electron/issues/10864#issuecomment-382519150
+  app.setAppUserModelId('com.knepper.android-messages-desktop');
+  app.setAsDefaultProtocolClient('android-messages-desktop');
+}
+
 app.on('ready', () => {
   setApplicationMenu();
   autoUpdater.checkForUpdatesAndNotify();