Get In-App reviews in Android

Photo by Towfiqu barbhuiya on Unsplash

So, you’ve released an app on the Google Play Store, and it’s doing well. However, we now want the user’s preferences to be displayed in the Play Store via reviews.

But why do we need the reviews in the first place?

Good evaluations in your app have a significant impact on your product, such as a higher rating in the Google Play Store, and it also helps a new user trust your app more.

However, so far, we have shown some custom to lead them to the Play Store and ask consumers to leave a review there.

However, it has a few flaws, including as —

  • The user may choose to leave without leaving a review.
  • The user may abandon the app, which is a negative point because the user is abandoning the app. We don’t want our customers to abandon the app.

To address these issues, Google released an In-App Review API as part of the Play Core library, which we can use to add reviews from within our application without having to leave it, resulting in a very pleasant user experience.

We will learn, in this blog, how to:

  • When should you ask a user to provide a review for the app?
  • What’s the best way to use the new In-App review API?
  • How do you put the InApp Review to the test?

When —

If the user has enjoyed a feature in your app or has completed a level in your game, this could be a good time to reveal the Review UI to them.

Google has also published some tips for when you should not request a review, such as —

  • It’s not a good idea to add custom UI to the Review UI flow.
  • We shouldn’t ask the user for a review very often because there are quotas attached to it. Also, there should be no call to action, such as a button, to start the In-App Review API; otherwise, users may exceed their quota by triggering the API repeatedly.

How —

Let’s get started with the API integration in our app.

Step 01:

Because the In-App Review is part of the Play core library, we’ll need to include the necessary dependencies in our build.gradle file —

implementation '' 
implementation ''

Step 02:

We need to find out where we should ask the user for a review now that the dependencies have been included. Make sure you inquire at a positive location where the user has accomplished something, such as, As an example,

  • If you’re a rental space app that helps individuals find roommates for their empty rooms, the greatest time to ask for a review is after you connect the user with a potential roommate.
  • If you’re making a gaming app, show them after they’ve completed a level or something similar.

They would enthusiastically score and review your application because they had a positive experience with what they were looking for.

Step 03:

Let’s get started integrating the Review API now that we’ve figured out the ideal trigger point for asking for a review.

First, we must construct a ReviewManager instance that will assist us in starting the API. We can create an instance like this.

Inside the addOnCompleteListener, we just keep the application’s flow running irrespective of what the results are.

Now, we are done setting up the In-App Review in our application.

Let's test the in-App review —

Now that the flow has been integrated, we must test it to ensure that it functions properly for us. To achieve so, we can use a variety of methods, such as,

Test your application by uploading it to the internal test track.
Upload your app to internal app sharing and run through the evaluation process.

Now, we used FakeReviewManager instead of ReviewManagerFactory in test cases to check if the review flow is complete and the app’s flow is operating in the intended flow.

val manager = FakeReviewManager(this)

This would not activate the UI, instead of focusing on faking the outcome by providing us with a bogus ReviewInfo object. You will see the Review UI only if your primary account has not already reviewed the app.

That's all folks!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store