Where in Windows 8 app should you code 'privac

2019-04-26 13:06发布

问题:

my app failed certification with reason : "4.1.1 Your app must have a privacy statement if it is network-capable . . . You must provide access to your privacy policy in the Description page of your app, as well as in the app’s settings as displayed in the Windows Settings charm."

What are they talking about? what description? how do I set info displayed in windows settings?

the app is C#

回答1:

You should state whether your app is collecting any information and what you're doing with it. If you don't do so, still say so.

According to their rules you're supposed to show such a notice at two different locations:

  • In the app description (obviously what's visible on the app store).
  • In the settings menu.

I assume the latter can be any custom label or text showing control displaying such a notice. Just read section 4.1.1. here. Just keep in mind that this can be any data sent to the internet, e.g. highscores, matchmaking information or maybe just some update check for data.

If you're using some kind of highscore list, you could just include some notice like this:

This app transmits your highscore with your nickname to our servers if you choose to do so. We won't share this data with any third party and will only use it to compile the official high score list.

I'm no lawyer and as such can't give you any really apropriate and accurate policy depending on your app, but it should give you an idea on what they're looking for. If you're still unsure, try to check apps doign similar things to yours.

More information regarding the settings charm can be seen found on MSDN and in this blog post.



回答2:

To add a link to your privacy policy:

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

// You can put this event handler somewhere in a main class that runs your app.
// I put it in may main view model.
SettingsPane.GetForCurrentView().CommandsRequested += ShowPrivacyPolicy;

// Method to add the privacy policy to the settings charm
private void ShowPrivacyPolicy(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
    SettingsCommand privacyPolicyCommand = new SettingsCommand("privacyPolicy","Privacy Policy", (uiCommand) => { LaunchPrivacyPolicyUrl(); });
    args.Request.ApplicationCommands.Add(privacyPolicyCommand);
}

// Method to launch the url of the privacy policy
async void LaunchPrivacyPolicyUrl()
{
    Uri privacyPolicyUrl = new Uri("http://www.yoursite.com/privacypolicy");
    var result = await Windows.System.Launcher.LaunchUriAsync(privacyPolicyUrl);
}


回答3:

Instead of opening a webpage link, you can directly code the Privacy policy in the code itself. In App.xaml.cs, paste the following code

        private void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
    {
       var privacy = new SettingsCommand("PrivacyPolicy", "PrivacyPolicy", (handler) =>
            {
                var settings = new SettingsFlyout();
                settings.Content = new PrivacyUserControl();
                //settings.HeaderBrush = new SolidColorBrush(_background);
                //settings.Background = new SolidColorBrush(_background);
                settings.HeaderBrush = _Hbackground;
                settings.Background = _background;
                settings.HeaderText = "Privacy Policy";
                settings.IsOpen = true;
            });

        args.Request.ApplicationCommands.Add(privacy);

        UICommandInvokedHandler handler1 = new UICommandInvokedHandler(onSettingsCommand);

           //  throw new NotImplementedException();
    }

 void onSettingsCommand(IUICommand command)
    {
        SettingsCommand settingsCommand = (SettingsCommand)command;
        ((Frame)Window.Current.Content).Navigate(typeof(HelpPage), "");
    }

Create a new user control

<UserControl
xmlns:common="using:App.Common"
x:Class="App.UserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">


<Grid>
    <StackPanel >
        <TextBlock Foreground="White"  Text="Privacy Policy" FontFamily="Segoe UI" FontWeight="SemiLight" FontSize="26.667" />
        <TextBlock Margin="0,50,0,0" Foreground="White" Text="put your notes here" FontFamily="Segoe UI" FontWeight="SemiLight" FontSize="18" TextWrapping="Wrap" />
    </StackPanel>
</Grid>



回答4:

At a recent MS win8 devcamp we were told the easiest option is to put a link to your online privacy policy in the settings charm for your app.

You can find some hands on labs in C# here:

http://msdn.microsoft.com/en-us/windows/apps/jj674832

Which contain a demo entitled 'Lab_Settings_CS' which you can copy and paste changing the 'About' page to your 'Privacy Policy' page - it's simply a new User Control.



回答5:

If your app doesn't contain any privacy policy and in certification you get the same 4.1 error then there are very simple steps you have to follow:

  1. Open your project
  2. In solution explorer double click package.appxmanifest.
  3. Open capabilities tab.
  4. uncheck the internet client.
  5. Create app package and upload it in the windows store.

That's all! :)