Google Unity 的应用内评论未显示,未抛出错误

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

我们按照本指南 (https://developer.android.com/guide/playcore/in-app-review/unity) 为 Unity 实施应用内审查 Android。

我们添加了 google-play-core unity 插件,它应该在 Unity 中正确导入。

密码是:

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

当我们想要显示协程时调用协程:

StartCoroutine(requireRate());

有什么建议吗? 谢谢

我刚测试过,功能正常..

在内部测试模式下测试游戏至少每次请求时它都会出现。在我的测试中,我没有使用任何按钮,我只是在游戏的某个阶段调用了这个函数,它运行得很好。

//Require..
using Google.Play.Review;

public void requestFunction()
    {
        StartCoroutine(requireRate());
    }

//somewhere in your code after completing the game ..
requestFunction();

已安装包管理器: //Google播放In-app评论

在其他设备上测试,令我惊讶的是我的帐户没有用,原因未知,但我在内部 Google 游戏控制台测试程序列表中的其他 3 台设备上进行了测试和非常积极的回应。

正如 Vins 所说

简单请求审核。

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

您仅在 已发布内部测试 上显示评论对话框。确保将在您的设备上登录的 google 个帐户添加到测试人员列表中。

阅读更多:https://developer.android.com/guide/playcore/in-app-review/test

使用内部测试轨道对我有用,但有一个主要警告。

如果在您的内部测试轨道中使用 G-Suite 帐户进行测试,则不会显示弹出窗口。

我不太确定为什么会这样,但它似乎已经存在多年了。 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 在他们的官方文档中,以确保测试有效,他们也应该包括这个。