We followed this guide (https://developer.android.com/guide/playcore/in-app-review/unity) to implement In-App Review for Unity Android.
We added google-play-core unity plugin and it should be imported correctly in Unity.
The code is:
private IEnumerator requireRate(){
// Create instance of ReviewManager
ReviewManager _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 _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.
}
And we invoke the coroutine when we want to show it:
StartCoroutine(requireRate());
Any advice? Thanks
If you're wondering why a Google review isn't showing up, it could be that it violated the Google review policy. The review can also disappear when regular users flag the review as inappropriate. In these cases, Google investigates by looking at the review in question before deleting it from the listing.
Set up your Unity project Add the Android resources to your Unity project. In Unity, click ** Window > Google Play Games > Setup... > Android Setup **. Complete the these items in the setup windows: Directory to save constants: The folder for the constants file.
Since external Unity packages are integrated slightly better nowadays using Google's package is not that pain. Case closed. Ok, I've used it, uploaded my apk tp internal test on play console. downloaded it using a tester account. but still couldn't show the in app review prompt!
Note: Downloading and use of the Google Play Unity Plugins is subject to the Play Core Software Development Kit Terms of Service . By downloading and using the Google Play Unity Plugins, you agree to the Play Core Software Development Kit Terms of Service. Create an instance of ReviewManager that handles communication between your app and the API.
The Play in-app review API is part of Play Core SDK family. The API for Unity offers a ReviewManager class to request and launch the flow using the RequestReviewFlow and LaunchReviewFlow methods. After a request is made, your app can check the status of the request using ReviewErrorCode. Set up your development environment
Yes but it would be 100x easier to use Unity built-in one like you do with iOS review API. No need to install more plugins + add unnecessary stuff. Since external Unity packages are integrated slightly better nowadays using Google's package is not that pain.
Simple request review.
using Google.Play.Review;
...
public void RequestReview()
{
// StartCoroutine(AndroidReview());
var reviewManager = new ReviewManager();
// start preloading the review prompt in the background
var playReviewInfoAsyncOperation = reviewManager.RequestReviewFlow();
// define a callback after the preloading is done
playReviewInfoAsyncOperation.Completed += playReviewInfoAsync =>
{
if (playReviewInfoAsync.Error == ReviewErrorCode.NoError)
{
// display the review prompt
var playReviewInfo = playReviewInfoAsync.GetResult();
reviewManager.LaunchReviewFlow(playReviewInfo);
}
else
{
// handle error when loading review prompt
}
};
}
You only show dialog Review on Published or Internal Test. Make sure that google accounts that are logged in on your device are added to the tester lists.
Read more : https://developer.android.com/guide/playcore/in-app-review/test
//Require..
using Google.Play.Review;
public void requestFunction()
{
StartCoroutine(requireRate());
}
//somewhere in your code after completing the game ..
requestFunction();
Package Manager installed: //Google Play In-app Review
testing on other devices, to my surprise on my account it didn’t work, the cause is not known, but I tested on 3 other devices from the list of the internal Google play console test program and very positive response.
Exactly as Vins says
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With