Responsive Advertisement

Google Play In-App Review API IN ANDROID STUDIO USING JAVA

INTRODUCTION

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.




Types of app update

  • Flexible
  • Immediate





DEVICE REQUIREMENTS

In-app reviews only work on the following devices:

  • Android devices (phones and tablets) running Android 5.0 (API level 21) or higher that have the Google Play Store installed.
  • Chrome OS devices that have the Google Play Store installed.

LET'S INTEGRATE IN-APP REVIEW IN ANDROID STUDIO USING JAVA

Create a new project in android studio using java

add this library to your android studio

implementation 'com.google.android.play:core:1.8.2'

after adding this library to build.gradle (module level) sync the project
after syncing goto activity where you want to add implement in app review add this 
method to to your activity and call on button click or whereever you want to click

private void callInAppReview() {
ReviewManager manager = ReviewManagerFactory.create(this);
Task<ReviewInfo> request = manager.requestReviewFlow();
request.addOnCompleteListener(task -> {
if (task.isSuccessful()) {
// We can get the ReviewInfo object
ReviewInfo reviewInfo = task.getResult();
Task<Void> flow = manager.launchReviewFlow(this, reviewInfo);
flow.addOnCompleteListener(task2 -> {
});
} else {
callToast(getString(R.string.something_wrong));
}
});
}




Post a Comment

0 Comments