应用内审核会调用日志,但不会启动对话框

问题描述

我有一种情况,我使用此方法调用应用内审核对话框,但是当测试版本是应用程序或应用程序在Play商店中发布时,该对话框不会出现。但是,LogCat Info显示调用代码时正确调用了该方法。任何人都可以提供建议或建议,谢谢。

https://developer.android.com/guide/playcore/in-app-review

Gradle

implementation 'com.google.android.play:core:1.8.0'

onCreate

Log.i("rate","CALL MANAGER");
askratings();

代码

void askratings() {
    ReviewManager manager = ReviewManagerFactory.create(this);
    com.google.android.play.core.tasks.Task<ReviewInfo> request = manager.requestReviewFlow();
    request.addOnCompleteListener(task -> {
        if (task.isSuccessful()) {
            // We can get the ReviewInfo object
            ReviewInfo reviewInfo = task.getResult();
            Log.i("rate","SUCCESS FLOW");
            com.google.android.play.core.tasks.Task<Void> flow = manager.launchReviewFlow(this,reviewInfo);
            flow.addOnCompleteListener(task2 -> {
                // 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.
            });
        } else {
            Log.i("rate","NOT A SUCCESS FLOW");
        }
    });
}

日志

2020-08-18 11:17:03.641 13328-13328/my.app I/rate: CALL MANAGER
2020-08-18 11:17:03.764 13328-13328/my.app I/rate: SUCCESS FLOW

解决方法

我必须使用内部应用程序共享和Android 10模拟器来查看对话框。在Android 9及更高版本中,我看到的日志与您看到的日志相同,但不会弹出任何评论。无论如何,我确实看到android虚拟按钮菜单出现了一个小故障,所以我认为这意味着流程正在工作。