Reputation: 117
I have a situation where I use this method to call a dialog for the In-App Review, but the dialog does not appear either when the test version is an app, or when the app is live in the Play store. However, LogCat Info shows that the method is called properly when the code is called. Can anyone help with advice or suggestion, thanks.
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();
Code
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");
}
});
}
Log
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
Upvotes: 3
Views: 1023
Reputation: 170
I had to use the Internal App Sharing and an Android 10 emulator to see the dialog. In Android 9 and previous I see the same logs as you do, but no review pops up. Anyway, I do see a glitch with the android virtual buttons menu appearing for a second, so I believe that means the flow is working.
Upvotes: 0