IEnumerator RequestReviewObject() { if (enableLog) { Debug.Log("Requesting Review Object"); } #if UNITY_EDITOR StartCoroutine(ShowReviewObject()); #endif _reviewManager = new ReviewManager(); var requestFlowOperation = _reviewManager.RequestReviewFlow(); yield return(requestFlowOperation); if (requestFlowOperation.Error != ReviewErrorCode.NoError) { if (enableLog) { Debug.LogError("Requesting Review Object Error" + requestFlowOperation.Error.ToString()); } yield break; } if (enableLog) { Debug.Log("Requesting Review Object Success"); } _playReviewInfo = requestFlowOperation.GetResult(); StartCoroutine(ShowReviewObject()); }
/** * Requests new Review and if no error shows banner */ internal static IEnumerator RequestReview() { _reviewManager = new ReviewManager(); var requestFlowOperation = _reviewManager.RequestReviewFlow(); yield return(requestFlowOperation); if (requestFlowOperation.Error != ReviewErrorCode.NoError) { // Log error. For example, using requestFlowOperation.Error.ToString(). yield break; } _playReviewInfo = requestFlowOperation.GetResult(); var launchFlowOperation = _reviewManager.LaunchReviewFlow(_playReviewInfo); yield return(launchFlowOperation); _playReviewInfo = null; // Reset the object if (launchFlowOperation.Error != ReviewErrorCode.NoError) { // Log error. For example, using requestFlowOperation.Error.ToString(). yield break; } }
IEnumerator ShowReviewObject() { if (enableLog) { Debug.Log("Showing Review Dialog"); } #if UNITY_EDITOR m_Success = true; m_CurrentPlayFrequency = 0; #endif if (_reviewManager == null) { yield break; } var launchFlowOperation = _reviewManager.LaunchReviewFlow(_playReviewInfo); yield return(launchFlowOperation); _playReviewInfo = null; // Reset the object if (launchFlowOperation.Error != ReviewErrorCode.NoError) { if (enableLog) { Debug.LogError("Showing Review Object Error. " + launchFlowOperation.Error.ToString()); } m_Success = false; yield break; } // The flow has finished. The API does not indicate whether the user // reviewed or not, or even whether the review dialog was shown. Thus, no // matter the result, we continue our app flow. if (enableLog) { Debug.Log("Showing Review Object Success"); } m_Success = true; m_CurrentPlayFrequency = 0; }