basquang™ on clouds

September 28, 2015

UWP: Open Store Rating to request user review and rate from your Windows 10 app

Filed under: UWP,windows 10 — basquang @ 4:32 PM
Tags: , , ,

In Windows Phone 8.x, you can use the Marketplace review task to launch the Store or Marketplace and then display the review page for the current app. The code is simple as below

MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
marketplaceReviewTask.Show();

Unfortunately, UWP Windows 10 app does not support this kind of Marketplace review task. So the question is “How to open review page for current app to request user to rate your app on Windows 10?” Solution is, you can use Windows.System.Launcher to launch the ms-windows-store: URI scheme. The URI schema to launches the write a review experience for a product for example are:

Product ID: ms-windows-store://review/?ProductId=9WZDNCRFHVJL
Package Family Name (PFN): ms-windows-store://review/?PFN= Microsoft.Office.OneNote_8wekyb3d8bbwe

And then, in your code, using one of the uriString above

await Windows.System.Launcher.LaunchUriAsync(new Uri(uriString));

For Windows app, using the second schema uri is my recommendation, because you can get PFN dynamically from your code by using Windows.ApplicationModel.PackageId.FamilyName
but Windows.ApplicationModel.PackageId.ProductID is only available for Windows Phone app.

Hope this help!

Advertisements

September 9, 2015

Best Practices: Upgrade to Windows 10 UWP Universal apps

Filed under: Microsoft Technology,UWP — basquang @ 11:29 AM
Tags: ,
Scenario:
– You have Windows Phone 8.x and Windows 8.x apps and want to upgrade the app to UWP Universal for Windows 10 to take advantage of new API platform?
– You just only want to update the Windows app to UWP but leave the phone app version in 8.x for some reason ex: AdMob SDK has not yet supported for Windows Phone 8.1 or later. Here are some best practices for you:
1. To target your UWP app only for Windows 10 devices without phone version
Open the Package.appxmanifest file then edit the Dependencies as below
<Dependencies>
    <!--<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />-->
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10240.0" />
  </Dependencies>
For this setting, you cannot deploy your app to Emulator or phone devices. And then when you upload the package to store, you will see the instruction below “Device families: Windows.Destop minverion 10.0.10240.0”
11638797_10204463343656324_1794777682_o
For more detail please visit msdn link here
https://msdn.microsoft.com/en-us/library/windows/apps/dn986903.aspx
2. Your UWP app using some extra features as access user appointments, contacts…but you do not see that capabilities in Package.appxmanifest to declare.
The solution is open Package.appxmanifest file then edit the node Capabilities as below:
<Capabilities>
    <Capability Name="internetClient" />
    <uap:Capability Name="appointments" />
  </Capabilities>
For more detail please visit msdn link here
https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx
https://msdn.microsoft.com/en-us/library/windows/apps/dn934741.aspx
3. You want to create settings page for your UWP looks like Microsoft Mail Universal app, which display the page flyout on the right. With Windows 8.x this will be completed by using SettingFlyout template, but the template is not supported for Windows 10 UWP.
Solution is create a new page or usercontrol then change the page/usercontrol class to inherit to Windows.UI.Xaml.Controls.SettingsFlyout. In UWP app the SettingsFlyout control is not visible in template selection but it still there in code.
public sealed partial class SettingsFlyoutControl : SettingsFlyout
<SettingsFlyout
    x:Class="LichViet.UserControls.SettingsFlyoutControl"...>
....
</SettingsFlyout>

Hope this help!

Blog at WordPress.com.