Windows Phone 8.1 Universal Apps 中 MarketplaceReviewTask 的替代品是什么



我到处找,就是找不到从我的应用程序启动Rate and Review的方法。有人知道如何在新的Windows Phone 8.1上启动此任务吗?

await Windows.System.Launcher.LaunchUriAsync(
    new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId));

这太好了!

没有MarketplaceReviewTask的直接替代品。现在它是这样工作的-通过使用LaunchUriAsync和适当的Uri-在"MSDN-链接到商店中的应用程序"中描述:

查看您可以使用的应用程序:

await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=[app ID]"));
// or simply for the current app:
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp"));

在上面的链接(MSDN)中,您还可以找到用于导航到详细信息页面并在存储中搜索指定内容的Uri结构。

还要注意的是,Windows Phone 8.1与WP 8.0具有向后兼容性,因此用于启动内置应用程序的所有URI方案都可以工作。所以你也可以这样使用它们:

查看应用程序:

await Windows.System.Launcher.LaunchUriAsync(new Uri(@"zune:reviewapp?appid=app" + YourAppID));

查看详细信息应用程序页面:

await Windows.System.Launcher.LaunchUriAsync(new Uri(@"zune:navigate?appid=[app ID]"));

我可以确认user3496220发布的方法正在工作,但前提是您使用的是来自开发中心的应用程序id(而不是CurrentApp.AppId)在你的案例中是这样的:

await Windows.System.Launcher.LaunchUriAsync(
    new Uri("ms-windows-store:reviewapp?appid=fc0c29fc-f615-4753-aad7-5cf760ca5d2d"));

我知道这个问题是专门关于Windows Phone 8.1通用应用程序的。但是,由于构建通用应用程序的主要原因是同时在Windows Phone 8.1和Windows 8.1上运行一个应用程序,我想补充一点,Windows应用商店应用程序的链接不同。

如MSDN中所述(http://msdn.microsoft.com/en-us/library/windows/apps/Hh974767.aspx)链接语法有点不同:

要创建Windows应用商店协议链接,请将应用程序的程序包系列名称附加到URL:

ms-windows-store:[action]P?PFN=[Package Family Name]

您可以从Microsoft Visual Studio中检索应用程序的程序包族名称,也可以访问应用程序基于web的列表页面并查看页面源。

可能的行动:

PDP     Opens an app's listing page.
Review  Opens the "Write a review" page of an app's listing.    

示例请求店铺审核的链接:

ms-windows-store:REVIEW?PFN=6509Knattips.StopNow_eadn2jc3headp

好的。我解决了这个问题。我不确定这是否是最好的方法,但这是唯一有效的方法。

我没有使用任何特殊的Uri,而是像这样直接链接到我的应用商店链接。如MSDN中所述。

但是有一个问题,如果你从未发布过你想启用审查的应用程序,你就没有链接。

感谢@Romasz分享MSDN链接。

这将打开重定向到商店的IE:

await Launcher.LaunchUriAsync(CurrentApp.LinkUri);

我发现了一种巧妙的方法来区分windows phone 8.1和windows phone 10,功能如下https://stackoverflow.com/a/37641902/3172445基于该功能,我使用以下代码使评级功能适用于wp8.1和wp10(在诺基亚Lumia 925、诺基亚Lumia735和诺基亚Lumia930上进行了测试)

        private async void OnTapRateThisApp(object sender, RoutedEventArgs e)
        {
            bool launched = false;
            try
            {
                // FUNCTION at https://stackoverflow.com/a/37641902/3172445
                if (this.liIsWindowsPhone81(false))
                {
                    await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId));
                }
                else
                {
                    await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store://review/?PFN=" + Package.Current.Id.FamilyName));
                }
                launched = true;
            }
            catch{}
            if (!launched)
            {
               // Unable to launch the uri
            }
        }

我想强调的是,我正在开发的应用程序只是一款windows手机,而不是UWP。

希望它能帮助

相关内容

  • 没有找到相关文章

最新更新