Once we publish our app over the PlayStore and as it became live there, app rating and reviews become very crucial to driving audience and downloads to your app. In order to increase this, we ask our users to rate the app through a popup window and redirecting them to the PlayStore. But this nowadays creates little problems, once users went to PlayStore they might not come back to our app. To overcome this issue Google provides an API called In-App Review to show the rating popup in the app itself so, the users don’t have to leave the application.
Points Regarding In-App Review API
- In-App Review is supported over the devices having Android 5(API level 21) or higher and have google PlayStore installed on the device.
- The API itself decides how often the review widget should be shown to the user, we should not call this API frequently as once a user reaches its maximum limit, the widget should not be shown to the user otherwise this may impact the user experience.
- The review flow is being controlled by the API itself, we shouldn’t try to alter its design.
- The review flow doesn’t indicate that the user has reviewed our app or not, also it doesn’t tell us anything about what the review widget has shown to the user or not.
Step By Step Implementation
Step 1: Creating A New Project
To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language.
Step 2: Adding Dependency
In-App Review API is a part of Play Core API. In order to use In-App Review API in our app, we need to add the dependency of Play Core API. Go to Gradle Scripts > build.gradle(Module: app) and add the following dependencies. After adding these dependencies you need to click on Sync Now.
Step 3: Working with the MainActivity.java file
In this step, we will create an instance of the ReviewManage interface, which provides the necessary methods to start the review flow. Once the instance is created we need to call the requestReviewFlow() method which returns the ReviewInfo object on successful completion. Using the ReviewInfo object we call the launchReviewFlow() method to start the review flow.
Step 4: Testing In-App Review
In order to test In-App Review, your application must have already approved by PlayStore. It doesn’t require the app to be publicly available but at least you should have a PlyaStore Account for Internal Testing(used for releasing the track and test In-App Review flow) or Internal App Sharing(used for testing In-App Review flow). You can find a sample image for In-App Review.