Are there any class in WinRT as MarketPlaceReviewTask in WP?

蹲街弑〆低调 提交于 2019-12-13 02:47:53

问题


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

Thanks.


回答1:


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.

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"));



回答2:


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.



来源:https://stackoverflow.com/questions/17021890/are-there-any-class-in-winrt-as-marketplacereviewtask-in-wp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!