Adding Privacy Policy for a Windows 8 App

Windows Store apps require a privacy policy. Here’s how.

App.xaml.cs


protected override void OnLaunched(LaunchActivatedEventArgs args)
 {
 Frame rootFrame = Window.Current.Content as Frame;

// Do not repeat app initialization when the Window already has content,
 // just ensure that the window is active
 if (rootFrame == null)
 {
 // Create a Frame to act as the navigation context and navigate to the first page
 rootFrame = new Frame();

if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
 {
 //TODO: Load state from previously suspended application
 }

// Place the frame in the current Window
 Window.Current.Content = rootFrame;
 }

if (rootFrame.Content == null)
 {
 // When the navigation stack isn't restored navigate to the first page,
 // configuring the new page by passing required information as a navigation
 // parameter
 if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
 {
 throw new Exception("Failed to create initial page");
 }
 }

// Ensure the current window is active
 Window.Current.Activate();
 SettingsPane.GetForCurrentView().CommandsRequested += SettingsCharmManager_CommandsRequested;
 }

public void SettingsCharmManager_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
 {
 args.Request.ApplicationCommands.Add(new SettingsCommand("privacypolicy", "Privacy Policy", OpenPrivacyPolicy));
 }

private async void OpenPrivacyPolicy(IUICommand command)
 {
 Uri uri = new Uri("http://mobile.cs.fsu.edu/privacy-policy");
 await Launcher.LaunchUriAsync(uri);
 }

About Frank Sposaro

Frank was the initial student to start the mobile lab with Dr. Tyson. After working on the first project, iFall, he and Dr. Tyson designed the Mobile Programming course as FSU. The course is used as a training base to recruit new students into the lab. His thesis researches several medical related applications, including iFall. Frank then went on to implement the redesign of the “favorite contacts” for Android’s Ice Cream Sandwich at Google HQ in Mountain View, California. He currently acts as a tech lead in the lab getting infrastructure and project management tools setup. He has special focus on native Android coding and UI design.