What's the replacement for MarketplaceReviewTask in Windows Phone 8.1 Universal Apps

后端 未结 7 1495
逝去的感伤
逝去的感伤 2020-12-14 10:23

I\'ve looked everywhere and just can\'t find a way to launch the Rate and Review from my app. Does anyone know how to launch this task on the new Windows Phone 8.1?

7条回答
  •  無奈伤痛
    2020-12-14 11:02

    I found a tricky way to distinguish a windows phone 8.1 against a windows phone 10, function at https://stackoverflow.com/a/37641902/3172445 based on that function i used the following code to make the rating function works on wp8.1 and wp10 (tested on Nokia Lumia 925, Nokia Lumia 735 and Nokia Lumia 930 )

            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
                }
            }
    

    I want to highlight that the app on which I'm working on, is a windows phone only, is not UWP.

    Hope it helps

提交回复
热议问题