/// <summary> /// Retrieves all the needed information to launch the in-app review flow. /// Needs to be called before <see cref="LaunchReviewFlow"/> to obtain /// a <see cref="PlayReviewInfo"/> which is required to launch the /// in-app review flow. /// </summary> public PlayAsyncOperation <PlayReviewInfo, ReviewErrorCode> RequestReviewFlow() { #if UNITY_EDITOR var operation = new ReviewAsyncOperation <PlayReviewInfo>(); operation.SetResult(new PlayReviewInfo(null)); return(operation); #else return(RequestReviewFlowInternal()); #endif }
/// <summary> /// Launches and displays the in-app review flow to the user. /// Returns a <see cref="PlayAsyncOperation"/> that will be marked IsDone when /// the in-app review dialog is closed. /// </summary> public PlayAsyncOperation <VoidResult, ReviewErrorCode> LaunchReviewFlow( PlayReviewInfo reviewInfo) { #if UNITY_EDITOR var operation = new ReviewAsyncOperation <VoidResult>(); operation.SetResult(new VoidResult()); return(operation); #else return(LaunchReviewFlowInternal(reviewInfo)); #endif }
private PlayAsyncOperation<PlayReviewInfo, ReviewErrorCode> RequestReviewFlowInternal() { var operation = new ReviewAsyncOperation<PlayReviewInfo>(); var requestFlowTask = _reviewPlayCoreTaskManager.RequestReviewFlow(); requestFlowTask.RegisterOnSuccessCallback(reviewInfo => { operation.SetResult(new PlayReviewInfo(reviewInfo)); requestFlowTask.Dispose(); }); requestFlowTask.RegisterOnFailureCallback((reason, errorCode) => { operation.SetError(ReviewErrorCode.ErrorRequestingFlow); requestFlowTask.Dispose(); }); return operation; }
private PlayAsyncOperation<VoidResult, ReviewErrorCode> LaunchReviewFlowInternal(PlayReviewInfo reviewInfo) { var operation = new ReviewAsyncOperation<VoidResult>(); var requestFlowTask = _reviewPlayCoreTaskManager.LaunchReviewFlow(reviewInfo.GetReviewInfo()); requestFlowTask.RegisterOnSuccessCallback(result => { operation.SetResult(new VoidResult()); requestFlowTask.Dispose(); }); requestFlowTask.RegisterOnFailureCallback((reason, errorCode) => { operation.SetError(ReviewErrorCode.ErrorLaunchingFlow); requestFlowTask.Dispose(); }); return operation; }