Google In-App Review for Unity not showing, not throwing errors
Asked Answered
C

5

8

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

Chemosphere answered 26/8, 2020 at 14:5 Comment(6)
I've used the same codes. Review dialog is not showing and not throwing errors. Does anybody have a solution? @VinserelloFerrick
I ran into that problem as you. As @AQuilisGuerrero said, it's not a problem of code but "testing" issue. If your code run without exceptions, then go to Google Play Console, create an internal-test release, add some testers and run the app. IMPORTANT: Don't use your publisher account as tester and use some different devices for test.Chemosphere
Thanks for your answer. My app is published on google play. I didn't reviewed the app. This must work on the production app, because else no one can give a review? Internal test release doesn't help here for the production app. I've also tried with different gmail accounts. Nothing helped.Ferrick
You're right, but internal test can be used to verify if IAR dialog is shown correctly. But, have you already published your app with IAR as production release?Chemosphere
No, I didn't published a production app with IAR. I'm just testing on my local machine and on my mobile device.Ferrick
Ah ok. Android Docs suggests using an internal test. If it works in internal testing, upgrade that version to production. The test on your local computer may not work properly because IAR will only be shown if you are using a version downloaded from Google Play. If you try on your machine you will get neither errors nor results.Chemosphere
I
2
//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

Inappropriate answered 28/8, 2020 at 4:41 Comment(1)
Our version is Google Play In-App Review 1.2.0 as well. How do you change account? You just change it on Google Play app, and then retry the code in-game?Chemosphere
F
4

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

Featherveined answered 18/9, 2020 at 15:8 Comment(1)
Thank you very much for adding using Google.Play.Review; too few people write the required using. Even documentation sometimes forgets to mention usings and it can be hard to find out which one I should use even with the IDE's help.Helfant
C
3

Using the internal test track worked for me, with one major caveat.

If are testing with a G-Suite account in your internal test track, the popup will not show.

I'm not really sure why this is the case, but it appears to be an issue for many years now. So many threads reporting this bug (where GSuite users can't leave Google Play reviews at all), and as of October 2020, Google still hasn't done anything about it. Google lists four conditions in their official documentation to ensure testing works, they should also include this.

Citation answered 7/10, 2020 at 1:33 Comment(2)
Same for me - I had to test on internal track, and my g-suite account didn't work, but my personal (gmail) google account worked fine.Valentinvalentina
I logged a documentation bug for their docs as you called out issuetracker.google.com/issues/173928185Valentinvalentina
I
2
//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

Inappropriate answered 28/8, 2020 at 4:41 Comment(1)
Our version is Google Play In-App Review 1.2.0 as well. How do you change account? You just change it on Google Play app, and then retry the code in-game?Chemosphere
I
0

I just tested it, and it's functional ..

Testing with game in internal test mode at least it appeared every time it was requested. In my test I didn't use any buttons, I just called the function at a certain stage of my game and it works perfectly.

Inappropriate answered 27/8, 2020 at 1:32 Comment(3)
Can you show us how did you do it? and the result to the OP.Wreathe
I'm testing with "internal test" of the Google Play Console, but nothing. It's correct to put it inside a IEnumerator Coroutine?Chemosphere
yes exactly as you posted. Did you import the correct packages? my version is Google Play In-app Review 1.2.0Inappropriate
I
0

Go to the Google Play app info, clear storage, and cache.

Ive answered 17/8, 2022 at 12:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.