0
\$\begingroup\$

So i installed this plugin https://github.com/google/play-unity-plugins/releases in my unity project so that I can add in-game review in my project. Script for that is:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;
using Google.Play.Review;
using UnityEditorInternal;

public class reviewManager : MonoBehaviour
{
private ReviewManager _reviewManager;
private PlayReviewInfo _playReviewInfo;
int launchCount;
// Start is called before the first frame update
void Start()
{
    launchCount = PlayerPrefs.GetInt("launch");
    launchCount += 1;
    PlayerPrefs.SetInt("launch", launchCount);

    if (launchCount == 3)
    {
        StartCoroutine(requestReview());
    }
}


// Update is called once per frame
void Update()
{
    
}

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;
    }
    // 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.
}

}

Now my build option is not working and this is the error. enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.