- Home /
Google review manager issue
I added the google play core package as instructed in the repo, and added the code according to the documentation here
I receive the following error: CS0246: The type or namespace name 'PlayAsyncOperation<,>' could not be found (are you missing a using directive or an assembly reference?)
This error shows at _reviewManager.RequestReviewFlow();
and _reviewManager.LaunchReviewFlow(_playReviewInfo)
Any idea what could be the issue?
My full code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Google.Play.Review;
public class ReviewCodes : MonoBehaviour
{
private ReviewManager _reviewManager;
private PlayReviewInfo _playReviewInfo;
// Start is called before the first frame update
void Start()
{
StartCoroutine(RequestReviews());
}
// Update is called once per frame
void Update()
{
}
IEnumerator RequestReviews()
{
// Create instance of ReviewManager
_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.
}
}
Hey! I'm also stuck on the same error. Did you get any solution?
It has been some time since I solved the issue, But I believe you need to wrap it in: #if UNITY_ANDROID #endif
That goes for both StartCoroutine(RequestReviews());
and IEnumerator RequestReviews()
function.
Hope that solves the problem.
Your answer
Follow this Question
Related Questions
Setting up new scenes as in-app purchases downloadable map packs? 1 Answer
How long it takes for Pending Review on Asset store? 0 Answers
Goolge play multiplayer service ...need help with automatch 0 Answers
'ArgumentException: Requested value 'X86' was not found.' 1 Answer
Unity FB SDK - Android app installs reported not adding up 0 Answers