Adding a Privacy Policy (and other settings) to an XNA Windows 8 game

One of the reasons my app failed to get certification is because of a lack of a privacy policy. More specifically, a lack of a privacy policy accessible in game. Some quick research showed up that this is an issue for a lot of initial releases, with many suggestions on how to fix the problem. I tried a few out, then ended up putting a few of them together, but I now have a solution which seems to work quite well and seems to give a method of accessing other programmer defined options in game.

The way I’ve made it accessible is through the Settings charm in Windows 8. In case you don’t use this much (let’s face it, I don’t), it appears if you touch or put your mouse to the top right hand corner of your Windows 8 screen and click the Settings cog icon. When not in an app it just shows computer settings, but in an app in shows you options as defined by the programmer.

There are 4 parts to adding the privacy policy; some declarations of namespaces, an args call, 2 new methods and a privacy policy itself. Beginning with the privacy policy itself, it needs to be available online somewhere so that you can access it. Mine is currently available at https://adamboyne.wordpress.com/2013/02/08/privacy-policy/ is you wanted to have a look. Because my app uses no external resources I just say that I access nothing, a quick search can find the policies used by other people who had this issue as well. Once it is available we can code in access to it.

Next we have the namespace declarations. At the top of your Game1.cs, add the following:

 using Windows.UI.ApplicationSettings;  
 using Windows.System;  

Next up comes the two methods; setting up the option and the action(s) that option has. The first method sets up the option in the settings window, namely the name of the command to appear and linking to what it does. The code looks like this:

 void SuperPong_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)  
     {  
       SettingsCommand privacyPolicyCommand =  
         new SettingsCommand("privacyPolicy", "Privacy Policy", (uiCommand) => ShowPolicyPage());  
       args.Request.ApplicationCommands.Add(privacyPolicyCommand);  
     }  

Where the first line sets up the options and the second line gets windows to add the option to the settings window. You can see the method ShowPolicyPage() here. This is binding the method as the action which occurs when the option is selected. The ShowPolicyPage() method looks like this:

     private async void ShowPolicyPage()  
     {  
       Uri uri = new Uri("http:// YOUR PRIVACY POLICY ADDRESS .com");  
       await Launcher.LaunchUriAsync(uri);  
     }  

Where the uri is the address of your policy (in case I hadn’t made it obvious) and the Launcher opens the the website so that the user can view your policy.

The last thing we have to add is the call to the methods to set up the new Option. This is done in LoadContent() so it is only set up once. It is only one line;

 SettingsPane.GetForCurrentView().CommandsRequested += SuperPong_CommandsRequested;  

Add this calls the methods which set everything up for you. Based on this I think it is possible to add actual options this way, such as in game settings like difficulty and volume. I will look in these at a later date, but for now just getting the privacy policy accessible was the aim. I’ll put the websites I used down the bottom of this post, the second of which has more information about what you can put in the individual options.

Adam

Sources:
http://fczaja.blogspot.co.uk/2013/05/windows-store-your-app-doesnt-meet.html
http://blogs.msdn.com/b/going_metro/archive/2012/04/22/integrating-with-windows-8-settings-charm.aspx

Advertisement

One thought on “Adding a Privacy Policy (and other settings) to an XNA Windows 8 game

Add yours

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Website Powered by WordPress.com.

Up ↑

%d bloggers like this: