Archive for April, 2013

Win8 JS Privacy Policy Settings

As part of the Windows 8 App Store requirements, if your app has internet/network connectivity then you’re required to not only have a privacy policy in your app store description, but also as a Charms menu item. Unfortunately all the docs suck for how to add a simple charms menu item to open the privacy policy in a new window using JavaScript 🙂

After lots of digging, I’ve come up with a simple bit of JavaScript code, that should also let you add other Charms Settings menu settings without tearing your eyes out trying to read the docs.

var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView();
function commandsRequested(eventArgs) {
var applicationCommands = eventArgs.request.applicationCommands;
var privacyCommand = new Windows.UI.ApplicationSettings.SettingsCommand('privacy', 'Privacy Policy', function() {
window.open('www.link.to.your/privacy_policy.html');
});
applicationCommands.append(privacyCommand);
}
settingsPane.addEventListener("commandsrequested", commandsRequested);

3 Comments