Are there any class in WinRT as MarketPlaceReviewT

2019-08-04 00:32发布

Are there any class in WinRT as MarketPlaceReview or MarketPlaceSearch Tasks in WP?

Thanks.

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-08-04 01:15

You can use Windows Store's protocol with specific arguments to launch several tasks related to Store like

If you want to open review page for any app then, you can open with this line.

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=MY_PACKAGE_FAMILY_NAME"));

If you open the page of particular app in Store app then you can open with this line.

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:PDP?PFN=MY_PACKAGE_FAMILY_NAME"));

MY_PACKAGE_FAMILY_NAME can be found in Package.appxmanifest file.

enter image description here

If you want to search within Store then you can open the Store app with search result with this line.

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:Search?query=YOUR_SEARCH_KEYWORDS"));

The below are the examples which open review page for Nokia Music app, the app page itself & queries Store with text "nokia music" respectively.

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:REVIEW?PFN=NokiaCorporation.NokiaMusic_6d0q6r3z979nw"));

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:PDP?PFN=NokiaCorporation.NokiaMusic_6d0q6r3z979nw"));

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:Search?query=nokia music"));
查看更多
在下西门庆
3楼-- · 2019-08-04 01:34
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:Search?query=YOUR_SEARCH_KEYWORDS"));

In above answer, the line I pasted above here, It is not working in windows phone 8.1. query parameter is wrong, Here we need to use keyword as a parameter.

So, below is the code with right url.

await Windows.System.Launcher.LaunchUriAsync(
    new Uri(string.Format("ms-windows-store:search?{0}={1}", type ,searchTerms)));

Please, check answer here.

查看更多
登录 后发表回答