Google Play In-App Review Implementation in Android

Satyam Gondhale
4 min readAug 16, 2020

--

We develop Android apps & release on Play Store. As an Developer or say Business Perspective it’s very important to know whether users are enjoying the app or facing any issues. To know this Play Store has a Ratings & reviews section for each app released on play store. Users can submit the ratings and has a freedom to write a review for a particular app. This approach is quite a lengthy to rate & review app i.e navigate to Play store to submit feedback or redirect leaving a current app workflow to open Play Store App link using URI. We never wanted our customers to leave our application, but with this flow, we are forced to redirect the control to Play store app.

To avoid above lengthy cases, Google has release a new API for In-App review Functionality 😊. Let’s deep dive into it’s requirements, implementation & limitations. Google Docs for In-App Review

Requirements

  • Android devices should be running on Android 5.0 (API level 21) or higher and should have Google play store installed.
  • Chrome OS devices that have Google play store app installed.
  • Play core library with version 1.8.0 or higher.

What Does This Api Do ?

The in-app review flow can be triggered at any time throughout the user journey of your app. During the flow, the user has the ability to rate your app using the 1 to 5 star system and to add an optional comment. Once submitted, the review is sent to the Play Store and eventually displayed.

Google itself has provided design guidelines to follow & Quota Limitations to consider if Api implementation is successful. To know more give a read on

Implementation Steps

  1. Add Play core library dependency in build.gradle
implementation 'com.google.android.play:core:1.8.0'

2. Create ReviewManager, interface that lets your app start an in-app review flow. Obtain it by creating an instance using the ReviewManagerFactory

ReviewManager reviewManager;
reviewManager =
ReviewManagerFactory.create(MainActivity.this);

3. Request ReviewInfo Object. Use the ReviewManager instance to create a request task. If successful, the API returns the ReviewInfo object needed to start the in-app review flow.

Task<ReviewInfo> request = reviewManager.requestReviewFlow();request.addOnCompleteListener(new OnCompleteListener<ReviewInfo>() {
@Override
public void onComplete(@NonNull Task<ReviewInfo> task) {
if(task.isSuccessful()){
ReviewInfo reviewInfo = task.getResult();
Task<Void> flow = reviewManager.launchReviewFlow(MainActivity.this, reviewInfo);
flow.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
// 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 //
}
});
}
}
});

That’s done with implementation so simple.

Best Practices to Follow :

1. Determine good points in your app’s user flow to prompt the user for a review (for example, when the user completes a level in a game). When your app reaches one of these points then ask for in-app review flow.

2. Do not perform any actions (say showing Toast message etc), when review is submitted. It is always not guaranteed Review Dialog will invoked.

How to Test it Before releasing on Play Store 😕?

  1. Add Signed Apk in Internal Sharing Apk on Play Store here Internal Sharing Apk Page
  2. A link will be generated, share that link with team, ask them to reach up to point where Review flow is expected to invoked.
  3. While testing, flow will get invoked but Submit button is disabled.

You can experience this actual flow to review & rate on this Android App : Start Learning Android 😊😀.

Thanks for your valuable read. If you feel it informative do give a Claps & comments.😊

--

--