From 30c49550c89c1b69c680170d2dc247eac76bd463 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Feb 2017 01:24:12 +0100 Subject: push plugin --- .../phonegap-plugin-push/hooks/windows/setToastCapable.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js (limited to 'StoneIsland/plugins/phonegap-plugin-push/hooks/windows') diff --git a/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js b/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js new file mode 100644 index 00000000..b8cbcbc0 --- /dev/null +++ b/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js @@ -0,0 +1,12 @@ +module.exports = function(context) { + console.log('Updating appxmanifests with ToastCapable=true...'); + var path = require('path'); + var platformProjPath = path.join(context.opts.projectRoot, 'platforms/windows'); + var AppxManifest = require(path.join(platformProjPath, 'cordova/lib/AppxManifest')); + + ['package.phone.appxmanifest', 'package.windows.appxmanifest'].forEach(function(manifestPath) { + var manifest = AppxManifest.get(path.join(platformProjPath, manifestPath)); + manifest.getVisualElements().setToastCapable(true); + manifest.write(); + }); +} -- cgit v1.2.3-70-g09d2