In my (little) spare time recently, I’ve been playing around with developing Windows 8 Store apps. I submitted my very first app to the Store this week and unfortunately the app failed the certification process.
The reason for failure was simple… I requested Internet Connection permissions in the app and therefore, based on the Windows Store App certification requirements, I should have included a Privacy Policy link within the app. In fact, I needed to include the Privacy Policy link from the Settings Charm.
Of course, having never done this before I had no idea how to do this. After much searching, I finally figured out how to do this.
So if your app has failed in your quest to be certified, here’s the simple steps required to get a Privacy Policy link included in the Settings Charm for your Windows Store app….
C# Solution
1. Add the following name spaces
using Windows.UI.ApplicationSettings;
using Windows.UI.Popups;
2. Add the event handler to your app initialisation
SettingsPane.GetForCurrentView().CommandsRequested += SettingCharmManager_CommandsRequested;
3. Then add the following methods…
public SettingCharmManager()
{
SettingsPane.GetForCurrentView().CommandsRequested += SettingCharmManager_CommandsRequested;
}
private void SettingCharmManager_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(new SettingsCommand(“privacypolicy”, “Privacy Policy”, PrivacyPolicyLink));
}
private async void PrivacyPolicyLink(IUICommand command)
{
Uri uri = new Uri(“<enter the full URL to your Privacy Policy here>”);
await Launcher.LaunchUriAsync(uri);
}
JavaScript Solution
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('<enter your Privacy Policy URL here');
});
applicationCommands.append(privacyCommand);
}
settingsPane.addEventListener("commandsrequested", commandsRequested);
Assuming your Privacy Policy link is valid, you should not fail for this reason on your next app submission!