设为首页 收藏本站
查看: 1326|回复: 0

Windows 8 添加隐私策略(C++版)

[复制链接]
YunVN网友  发表于 2015-5-23 07:23:41 |阅读模式
  well.新年上班第一天.不幸收到MS官方针对我们Snack Cards应用程序被打回消息.看看Report 内容如下:
  The app has declared access to network capabilities and no privacy statement was provided in the Windows Settings Charm
  如上文.Windows 8应用程序中一旦使用网络连接则对应应用程序中需要对用户说明隐私策略.其实这让封装功能透明化一种方式.有必要让用户知道隐私一些细节.这其实也是通用一种方式.App Store更像一个平台.同时这也是MS一份"免责声明".但它打开的方式是放置在Windows 8 设置界面中.所以大部分用户大多很少打开.东西虽小.但又或不可缺.这无疑也透漏一种开发商和最终用户之间的"契约精神".
  其实针对隐私策略Privacy Policy 问题官方已经说得很明确如下:
4.1.1 Your app must have a privacy statement if it is network-capable
  If your app has the technical ability to transmit data, you must maintain a privacy policy. 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.
  App capability declarations that make your app network-capable include: internetClient, internetClientServer and privateNetworkClientServer.
  Your privacy policy must inform users of the personal information transmitted by your app and how that information is used, stored, secured and disclosed, and describe the controls that users have over the use and sharing of their information, how they may access their information, and it must comply with applicable laws and regulations.
  详见:Windows 8 app certification requirements[windows]
  
  在MS论坛上看到有人吐槽这个问题.其实问题很简单.因为应用程序一旦使用到了网络.其实在技术上有了实现传输用户敏感隐私数据的条件.针对这点微软官方必须强制维护一个隐私策略.其实就是一个网址.必须在你的应用的“描述”页中以及在显示于 Windows“设置”超级按钮中的应用设置中提供对你的隐私策略的访问途径.
看到很多应用隐私策略做的很粗糙.其实官方要求隐私策略必须告知用户你的应用传输的个人信息及如何使用、存储、保护和透露该信息,并且描述用户对使用和共享其信息.所具有的控制权以及他们访问其信息的方式,并且隐私策略符合适用的法律和法规.一个完整的隐私策略需要包含哪些内容[标准如下]
Include Infor: A:what information do we collect?B:What do we use your information for?C:How do we protect your information?D:Do we use cookies?E:Do we disclose any information to outside parties?F:Contacting Us [Info]
或是可以参考我们制作一个隐私参考版[Snack Studio Privacy Policy Document].页面有点粗糙.但内容较为完整规范.说道这如何向Windows 8 应用程序添加隐私策略?普遍方式在OnWindowsCreated事件中实现对隐私策略内容的添加[C#代码]:

   1:  protected override void OnWindowCreated(WindowCreatedEventArgs args)   2:  {   3:         SettingsPane.GetForCurrentView().CommandsRequested += PrivacyCommandsRequested;              4:         base.OnWindowCreated(args);   5:   }

  处理CommandRequested事件处理函数:


   1:   void PrivacyCommandsRequested(SettingsPane settingsPane, SettingsPaneCommandsRequestedEventArgs eventArgs)   2:      {   4:          UICommandInvokedHandler eventHandler = new UICommandInvokedHandler(onSettingsCommand);   5:          SettingsCommand privacyStatement = new SettingsCommand("SnackCardsPrivacy", "Privacy Policy", handler);   6:          eventArgs.Request.ApplicationCommands.Add(privacyStatement);                       7:      }  当用户点击Privacy Policy 时调用如下代码. 打开对应Url地址:


   1:  async void onSettingsCommand(IUICommand command)   2:   {   3:       if (command.Id.ToString() == "SnackCardsPrivacy")   4:           await Windows.System.Launcher.LaunchUriAsync( new Uri("http://www.snack-studio.com/privacy.html"));   5:   }  当用户操作点击隐私策略调用Launcher加载对应的Url地址.把网页内容显示在SettingPanel中.就是这么简单.但是如果在Xaml和Direct X混合应用程序.按照同样的思路来做的话.为了保证应用OnLaunch时间不超过5秒.推荐在应用程序中加载尽量减少操作.而是把这些操作放在MainPage 的OnLoaded或是OnNavigateTo事件中来加载.C++代码需要添加如下额外引用:


   1:  using namespace Windows::UI::ApplicationSettings;   2:  using namespace Windows::UI::Popups;  
在文件中声明操作事件如下:


   1:      public:   2:          DirectXPage();           3:      4:          void SaveInternalState(Windows::Foundation::Collections::IPropertySet^ state);   5:          void LoadInternalState(Windows::Foundation::Collections::IPropertySet^ state);   6:          //Add  Privacy Policy   7:          virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;   8:      9:      private:  10:          void OnRendering(Object^ sender, Object^ args);  11:          void PageLoaded(Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ args);  12:     13:          //Add  Privacy Policy  14:          void AddPrivacySetting(Windows::UI::ApplicationSettings::SettingsPane^ sender, Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs^ args);  15:          void AddBtnPrivacy(Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs^ args);  16:          void BtnPrivacyOnClicked(Windows::UI::Popups::IUICommand^ command);  
在OnNavigatedTo事件作如下调用:


   1:  void DirectXPage::OnNavigatedTo(NavigationEventArgs^ args)   2:  {      3:      SettingsPane::GetForCurrentView()->CommandsRequested += ref new TypedEventHandler(this, &DirectXPage::AddPrivacySetting);   4:  }  
对应回调方法是AddPrivacySetting方法:


   1:  void DirectXPage::AddPrivacySetting(SettingsPane^ sender, SettingsPaneCommandsRequestedEventArgs^ args)   2:  {   3:      this->AddBtnPrivacy(args);   4:  }   5:      6:  void DirectXPage::AddBtnPrivacy(SettingsPaneCommandsRequestedEventArgs^ args)   7:  {   8:      UICommandInvokedHandler^ handler = ref new UICommandInvokedHandler(this, &DirectXPage::BtnPrivacyOnClicked);    9:      args->Request->ApplicationCommands->Clear();  10:      SettingsCommand^ privacyPref = ref new SettingsCommand("CardPrivacyStament", "Privacy Policy", handler);   11:      args->Request->ApplicationCommands->Append(privacyPref);  12:  }  13:     14:  void DirectXPage::BtnPrivacyOnClicked(Windows::UI::Popups::IUICommand^ command)  15:  {  16:      using namespace Windows::Foundation;   17:      if(command->Id->ToString()=="CardPrivacyStament")  18:      {  19:         Windows::System::Launcher::LaunchUriAsync(ref new Uri("http://www.snack-studio.com/privacy.html"));  20:      }  21:  }  
也很简单.把C#逻辑改成C++版本.
  参考资料:
  Windows 8 app certification document [Windows 8]
  Windows 8 Certification and add Privacy Policy

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-69666-1-1.html 上篇帖子: Windows 8实用窍门系列:10.Windows 8的基本变换和矩阵变换以及AppBar应用程序栏 下篇帖子: 转:Windows 8上强制Visual Studio以管理员身份运行
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表