Florian Rousselet

Passionné de Windows Phone

[W8] Politique de confidentialité ou le fameux 4.1 mais en JS !

Comme j’ai pu déjà en parler dans cet article ([W8] La déclaration de confidentialité ou le fameux 4.1 sous Windows 8), pour chaque application accédant à internet, il faut produire une politique de confidentialité.

Mon précédent article était fait en C# et on m’a demandé dernièrement la version JS. Je ne suis pas un expert, mais le code marche :D

Le code est à placer dans default.js tel quel.  Vous devrez bien sur remplacer l’url google par celle de votre page. IE s’ouvrira ensuite sur votre page.

 


app.onactivated = function (eventObject) {

if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) {

 

var settingsPane = Windows.UI.ApplicationSettings.SettingsPane.getForCurrentView();

settingsPane.addEventListener("commandsrequested", onCommandsRequested);

 

}

}

 

function onSettingsCommand(){

window.open("http://www.google.fr", '_blank');

window.focus();

}

 

function onCommandsRequested(eventArgs){

var settingsCommand = new Windows.UI.ApplicationSettings.SettingsCommand("Politique de confidentialité", " Politique de confidentialité ", onSettingsCommand);

eventArgs.request.applicationCommands.append(settingsCommand);

}

[W8] Supprimer une application du Store Windows

J’ai du aujourd’hui supprimer une application du Store Windows, et je m’attendais à effectuer la même manipulation que sous Windows Phone mais que nenni !

Sous Windows Phone, il  suffisait de cacher l’application du market et le tour était joué.

Maintenant la procédure à suivre est la suivante (MSDN) :

  1. - Accédez à votre Tableau de bord.
  2. - Accédez à la page Détails de l’application.
  3. - L’application étant déjà sur le marché, vous devez créer une nouvelle version pour l’application. Pour commencer, cliquez sur Créer une nouvelle version.
  4. - Dans la page récapitulant la version de l’application, cliquez sur Détails de vente.
  5. - Désactivez la case à cocher pour chaque marché.
  6. - Enregistrez vos modifications et soumettez l’application.

Personnellement, j’ai du décocher tout les markets (pas d’options pour tout décocher) et c’est assez barbant vu le nombre de pays !

Le process est donc de créer une nouvelle version au niveau du market et de laisser tout le reste tel quel. Il faudra fournir une note de mise à jour (inutile pour le coup mais obligatoire quand même) et c’est bueno.

Par contre, vu le process il faut attendre comme si il s’agissait d’une véritable mise à jour soit actuellement 4/5 jours en moyenne.

C’est assez inhabituel comme manière de faire. Surtout quand on est habitué au modèle Windows Phone !

[W8] Privacy statement in Windows 8 or 4.1 requirement

After submitting my first application (a portfolio), I had the nice surprise to discover that the Windows 8 application submission differs in some points from Windows phone 7. Now, we have to produce a privacy statement when our application is connected to Internet.

How do I make that privacy statement ?

Thanks to Thomas Gobin which create a quick solution (http://ma.ms.giz.fr/) to make privacy statement you can build your own in FRENCH.

I translate it. Here you can have mine and change the name of the application « Florian Rousselet » by your proper application’s name. You’ll have to host it on your webserver.

 

Where do I put it ?

Well, at TWO places. During the submision, you’ll have to give the link of this privacy statement. In the description, you have a field  »Politique de confidentialité » (privacy statement in english) as you can see on the screen above (Tutoriel de David Catuhe)

This link will be in the bottom page of app’s description, example : http://apps.microsoft.com/webpdp/en-US/app/urzagatherer/92adce33-8490-4af7-9392-9c35c91d8a37

Next place, it’s inside the app. In the Windows Settings charm, example :

Let’s code !

Now, we have to add this privacy policy inside the application, for that we need some code. For this example, we will simply add a link to the internet page to that privacy policy.

Let’s go to the App.xaml.cs, inside the OnLaucnhed method. We’ll add SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;


protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// Do not repeat app initialization when already running, just ensure that
// the window is active
if (args.PreviousExecutionState == ApplicationExecutionState.Running)
{
Window.Current.Activate();
return;
}

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

// Create a Frame to act navigation context and navigate to the first page
var rootFrame = new Frame();
if (!rootFrame.Navigate(typeof(MainPage)))
{
throw new Exception("Failed to create initial page");
}

// Place the frame in the current Window and ensure that it is active
Window.Current.Content = rootFrame;
Window.Current.Activate();
SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;
}

Being inside the App.xamls.cs file, each opening of SettingsPane, the methode App_CommandsRequested will be called and we can work with it.


private  void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(

new  SettingsCommand("Privacy policy","Privacy policy",

async   a  =>
{
await  Windows.System.Launcher.LaunchUriAsync(new Uri("http://florian-rousselet.fr/W8/policy.htm"));
}));
}

That method will permit to add a command directly inside the SettingsPane with « Privacy policy » as title and as action the opening of Internet Explorer to your privacy policy.

Now with that, you’ll go through the 4.1 requirement :)

[W8] La déclaration de confidentialité ou le fameux 4.1 sous Windows 8

Après avoir soumis ma première application (un portfolio), j’ai eu l’agréable surprise de découvrir que la publication d’application Windows 8 comportait plusieurs points différents de Windows Phone 7. Maintenant, il faut produire une déclaration de confidentialité quand notre application accède à Internet.

Comment je fais cette déclaration de confidentialité ?

Là où c’est intéressant c’est que Thomas Gobin a créée une solution rapide pour réaliser cette politique de confidentialité !

http://ma.ms.giz.fr/

Vous renseignez votre nom d’application et le site se chargera de générer un document conforme. Par exemple http://ma.ms.giz.fr/?name=Florian+Rousselet

Et je la met où ?

Et bien, à DEUX endroits. Lors de la soumission, vous devez renseigner le lien internet de cette déclaration de confidentialité. Dans la partie description, vous avez un champ « Politique de confidentialité »comme vous pouvez le voir sur le screen ci-dessous (Tutoriel de David Catuhe)

Ce lien se retrouvera ensuite en bas de la page de description de l’application, exemple : http://apps.microsoft.com/webpdp/fr-ca/app/urzagatherer/92adce33-8490-4af7-9392-9c35c91d8a37

Second emplacement, c’est au sein même de l’application. Dans la charm bar Windows 8, bouton réglages, exemple :

Place au code !

L’ajout de la politique de confidentialité au sein de l’application requiert un peu de code. Pour cet exemple, nous allons simplement ajouter un lien vers la page internet de cette déclaration de confidentialité.

Rendez-vous dans le App.xaml.cs, dans la méthode OnLaunched et juste après Windows.Current.Activate(); nous allons ajouter  SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;


protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// Do not repeat app initialization when already running, just ensure that
// the window is active
if (args.PreviousExecutionState == ApplicationExecutionState.Running)
{
Window.Current.Activate();
return;
}

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

// Create a Frame to act navigation context and navigate to the first page
var rootFrame = new Frame();
if (!rootFrame.Navigate(typeof(MainPage)))
{
throw new Exception("Failed to create initial page");
}

// Place the frame in the current Window and ensure that it is active
Window.Current.Content = rootFrame;
Window.Current.Activate();
SettingsPane.GetForCurrentView().CommandsRequested += App_CommandsRequested;
}

Etant dans le fichier App.xaml.cs à chaque ouverture du SettingsPane (clic sur le bouton réglage), la méthode App_CommandsRequested sera appelée ici et nous pouvons ainsi travailler avec.


private  void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
args.Request.ApplicationCommands.Add(

new  SettingsCommand("Politique de confidentialité","Politique de confidentialité",

async   a  =>
{
await  Windows.System.Launcher.LaunchUriAsync(new Uri("http://florian-rousselet.fr/W8/policy.htm"));
}));
}

Cette méthode App_CommandsRequested va permettre d’ajouter une commande directement dans le SettingPane avec « Politique de confidentialité » comme titre et l’action lors du clic qui sera l’ouverture du lien internet vers la politique de confidentialité.

Normalement, avec ça vous devriez passer cette fameuse clause 4.1 :)

Older Posts »