Google Play In-App Review API

The Google Play In-App Review API lets you prompt users to submit Play Store ratings and reviews without the inconvenience of leaving your app or game.

Device requirements

In-app reviews only work on the following devices:

  • Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed.
  • Chrome OS devices that have the Google Play Store installed.
In app review workflow for a user

Play Core library requirements

To integrate in-app reviews in your app, your app must use version 1.8.0 or higher of the Play Core library.

When to request an in-app review

Follow these guidelines to help you decide when to request in-app reviews from users:

  • Trigger the in-app review flow after a user has experienced enough of your app or game to provide useful feedback.
  • Do not prompt the user excessively for a review. This approach helps minimise user frustration and limit API usage.
  • Your app should not ask the user any questions before or while presenting the rating button or card, including questions about their opinion (such as “Do you like the app?”) or predictive questions (such as “Would you rate this app 5 stars”).

Quotas

To provide a great user experience, Google Play enforces a time-bound quota on how often a user can be shown the review dialog. Because of this quota, calling the launchReviewFlow method more than once during a short period of time (for example, less than a month) might not always display a dialog.

Because the quota is subject to change, it’s important to apply your own logic and target the best possible moment to request a review. For example, you should not have a call-to-action option (such as a button) to trigger the API, as a user might have already hit their quota and the flow won’t be shown, presenting a broken experience to the user. For this use case, redirect the user to the Play Store instead.


Integrate in-app reviews

In app/build.gradle

...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // So, make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:core:1.10.0'

    // For Kotlin users also add the Kotlin extensions library for Play Core:
    implementation 'com.google.android.play:core-ktx:1.8.1'
    ...
}
final Activity activity = getActivity();
final ReviewManager manager = ReviewManagerFactory.create(activity);
//  ReviewManager manager = new FakeReviewManager(this);
Task<ReviewInfo> request = manager.requestReviewFlow();
request.addOnCompleteListener(new OnCompleteListener<ReviewInfo>() {
    @Override
    public void onComplete(@NonNull Task<ReviewInfo> task) {
        if (task.isSuccessful()) {
            ReviewInfo reviewInfo = task.getResult();
            Task<Void> flow = manager.launchReviewFlow(activity, reviewInfo);
            flow.addOnCompleteListener(new OnCompleteListener<Void>() {
                @Override
                public void onComplete(Task<Void> taskFlow) {
                    // 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 {
            // There was some problem, log or handle the error code.
            String reviewErrorMsg = task.getException().getMessage();
        }
    }
});

Test using the Google Play Store

  1. Test using an internal test track
  2. Test using internal app sharing

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

Leave a comment