Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Update appxmanifests with ToastCapable=true after plugin install (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Shakhnazarov authored and macdonst committed Aug 11, 2016
1 parent 30d3d5d commit eeefc03
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hooks/windows/setToastCapable.js
Original file line number Diff line number Diff line change
@@ -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();
});
}
1 change: 1 addition & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<framework src="libz.tbd"/>
</platform>
<platform name="windows">
<hook type="after_plugin_install" src="hooks/windows/setToastCapable.js"/>
<js-module src="src/windows/PushPluginProxy.js" name="PushPlugin">
<merges target=""/>
</js-module>
Expand Down

0 comments on commit eeefc03

Please sign in to comment.