Google Play In App Review API Integration
in this article i will show you how you can easily integrate google play Review api in your android app. its very easy and simple steps to add this feature in your android project by having this feature in app we can get more reviews from user . and all reviews will be display in our google play app page.user dont need to leave your application for review . user can submit review or can rate your app while using your app.

Google play Core Library 1.8.0 brings a much-awaited Feature In-app review. I already implemented this feature in one app and very happy with this feature. App Link you can check this feature by installing this app.
after this API integration in my app rating instantly boosted. and I got maximum positive reviews. just one thing that we need to keep in mind only shows the rating button when user completed any task in-app. for example in a game app user completed a level at that time you can ask for a rating. but don't ask for a rating every time when the user completed the level.
Google play in-app review API let you prompt the user to submit a play store rating without the inconvenience of leaving your application
Generally in app review can trigger any time and the user will see a rating dialog like the image below after selecting some stars user will have an optional option to submit a review and then this API will send that review to google play. and will display on your google play app page.
Device Requirement
Google play in-app review API only work in android devices that have minimum android version 5.0 (21 API) and have google play installed in their device.
When to ask for a review?
this is the very difficult part of the integration, you have to identify the place where to ask for a review.
to protect user privacy and misuse of API google has set very strict rules that are your app should follow.
here are google guidelines. you can check google guidelines on the official website. Documentation
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 minimize user frustration and limit API usage (see the section on quotas).
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”).
Google Play Review and rating API integration
first of all you need to add this in your app-level build.gradle file and sync project
implementation 'com.google.android.play:core:1.9.0'
next step is to create an instance of ReviewManager interface this interface lets you start in-app review process.
ReviewManager manager = ReviewManagerFactory.create(context)
ReviewManager instance is needed to create a Request task
Task request = manager.requestReviewFlow();
then you need to add success and failure listener if its return success its mean you can request for review dialogue here is code
request.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
ReviewInfo reviewInfo = task.getResult();
} else {
Log.d(TAG, "error "+task.getExceptio().getMessage());
}
});
if the task is successful then you will get ReviewInfo Object in task.getResult(); after having Reviewinfo object now we can launch Review Dialogue. below is the complete code is written.
The next Step is testing (How To Test Google Play Review API)
I made many mistakes when the first time I implemented this API in my android project and when I try to test this feature. I got so confused that time. I don't want to let you confused because if you follow all the above steps and try to test you won't see any rating dialogue until you fulfill all requirements. below are common issue and their solutions. read it carefully before testing.
- this feature only works if you have published an app in the play store.
- the second option is you can test this feature also by uploading this app apk on google play internal app sharing.
- if the user's device has not installed google play in-app then this app wouldn't show any rating dialog
- if the user already rated this app using their device default account in this case rating dialogue will not show in-app.
- The quota has been reached.
- if the user already rated this app then the rating dialog will not show.
these are the common issues that you can face while testing this feature. I hope you understand all the things. if you like this post please do like it.
What's Your Reaction?






