public async Task <bool> ShowRatingReviewDialog() { if (ApiInformation.IsMethodPresent(typeof(StoreRequestHelper).FullName, nameof(StoreRequestHelper.SendRequestAsync), 3)) { logger.Log("Review.SendRequest"); StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync( StoreContext.GetDefault(), 16, string.Empty); if (result.ExtendedError == null) { JObject jsonObject = JObject.Parse(result.Response); if (jsonObject.SelectToken("status").ToString() == "success") { // The customer rated or reviewed the app. return(true); } } // There was an error with the request, or the customer chose not to // rate or review the app. return(false); } else { logger.Log("Review.LaunchUri"); bool reviewResult = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-windows-store://review/?ProductId=9PCZBVLLDSX4")); return(reviewResult); } }
// code based on this: https://docs.microsoft.com/en-us/windows/uwp/monetize/request-ratings-and-reviews private async static void ShowRatingReviewDialog() { try { _alreadyPromptedForRatingThisSession = true; StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync( StoreContext.GetDefault(), 16, String.Empty); if (result.ExtendedError == null) { JObject jsonObject = JObject.Parse(result.Response); if (jsonObject.SelectToken("status").ToString() == "success") { // The customer rated or reviewed the app. Statistics.UserHasRatedApp = true; } else if (jsonObject.SelectToken("status").ToString() == "aborted") { // The customer chose not to rate the app Statistics.UserHasRatedApp = false; } } else { // There was an error rating the app } } catch { // don't crash app due to failure with rating / review Analytics.LogEvent(AnalyticsEvent.RatingReviewError); } }
public async Task <bool> ShowRatingReviewDialog() { StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync( StoreContext.GetDefault(), 16, String.Empty); if (result.ExtendedError == null) { return(true); } return(false); }
public static async Task TryRequestReviewAsync() { StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync( StoreContext.GetDefault(), 16, String.Empty); if (result.ExtendedError == null) { JObject jsonObject = JObject.Parse(result.Response); if (jsonObject.SelectToken("status").ToString() == "success") { // The customer rated or reviewed the app. } } }
public static async Task <bool> ShowRatingReviewDialog() { StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync( StoreContext.GetDefault(), 16, String.Empty); if (result.ExtendedError == null) { JObject jsonObject = JObject.Parse(result.Response); if (jsonObject.SelectToken("status").ToString() == "success") { // The customer rated or reviewed the app. return(true); } } // There was an error with the request, or the customer chose not to // rate or review the app. return(false); }
public static async Task <bool> ShowRatingReviewDialog() { if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Services.Store.StoreRequestHelper")) { StoreSendRequestResult result = await StoreRequestHelper.SendRequestAsync(StoreContext.GetDefault(), 16, String.Empty); if (result.ExtendedError == null) { JObject jsonObject = JObject.Parse(result.Response); if (jsonObject.SelectToken("status").ToString() == "success") { // The customer rated or reviewed the app. return(true); } } } return(false); }