MOBILE-2478 windows: Fix notifications not displayed in Windows

main
Dani Palou 2018-07-17 11:36:49 +02:00
parent 28db063a29
commit 3a48f5d4a6
1 changed files with 7 additions and 1 deletions

View File

@ -88,19 +88,25 @@ app.on('activate', () => {
fs.readFile(path.join(__dirname, 'config.json'), 'utf8', (err, data) => {
configRead = true;
var ssoScheme = 'moodlemobile'; // Default value.
// Default values.
var ssoScheme = 'moodlemobile',
appId = 'com.moodle.moodlemobile';
if (!err) {
try {
data = JSON.parse(data);
ssoScheme = data.customurlscheme;
appName = data.desktopappname;
appId = data.app_id;
} catch(ex) {}
}
// Set default protocol (custom URL scheme).
app.setAsDefaultProtocolClient(ssoScheme);
// Fix notifications in Windows.
app.setAppUserModelId(appId);
if (isReady) {
setAppMenu();
}