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. User can give 1 to 5 star & comment will be optional.
For users & developers, rating & reviews are import. Through rating & review, users can decide which application is right for them. Developers become to know what users love and what they should improve in app. If there is an option through which users give review within application, without leaving the application, it will be more convenience for users.
Integration in-app reviews
Set up your development environment
- Add dependency in build.gradle.
1implementation 'com.google.android.play:core:1.8.0' - The
ReviewManager
is the interface that lets your app start review flow. Obtain it by creating an instance using theReviewManagerFactory.
1val manager = ReviewManagerFactory.create(context)
- Create a ReviewManager instance and request ReviewInfo object. The ReviewInfo object to be pre-cached before calling
launchReviewFlow
method. So, it should fetch ahead of time.
1234567891011private var reviewInfo: ReviewInfo? = nullval manager = ReviewManagerFactory.create(context)val request = manager.requestReviewFlow()requestFlow.addOnCompleteListener { request ->if (request.isSuccessful) {//Received ReviewInfo objectreviewInfo = request.result} else {//Problem in receiving objectreviewInfo = null} - Use the
ReviewInfo
instance to launch the in-app review flow
1234val flow = manager.launchReviewFlow(activity, reviewInfo)flow.addOnCompleteListener { _ ->}
For more information, check following link : Google Play In-App Review