Request app rating

With an App Review Request, you can use your tracked events and other triggers in Leanplum to present an app review prompt, integrated with the App and Google Play Stores, to your users at just the right time. You can ( of course as we always recommend! ) also segment and A/B test this campaign with a Holdback to find the most effective way to ask users to rate your app.

In this guide, you will find how to set up a review request on the iOS and Android side.

iOS Review Request Setup
Android Review Request Setup

iOS Review Request Setup

As you are setting up your iOS review request in Leanplum, there are few important things you need to keep in mind as you use this message:

  1. Apple limits the amount of times you can serve an App Review prompt to your end user to three times in one year (365 days). Because of this your prompt may not display has you intend. In this situation we highly recommend using an in-app message first as a "pre-permission" so it does not count against your App Review count
  2. Apple does not make visible if the user was shown a ratings prompt nor if they interacted with it. For this reason, we again would recommend the Leanplum in-app message "pre-permission" prompt. This way you can see analytics on the Leanplum message, since the actual Request App Rating prompt analytics will not be provided

How To: Set Up an iOS App Rating In Leanplum

Here's how to send a pre-permission that triggers the App Review prompt:

  1. On Campaigns overview page click Create Campaign
  2. Select the Confirm template from the In-App Message channel.
2040
  1. Edit the Title and Message fields. We highly recommend using a generic message like "Do you like this app?" with "Yes/No" options, since iOS may not display the iOS App Review (the user may disabled it or if iOS determines not to display it).

  2. Set the Accept Action to Request App Rating.

605
  1. Edit the Audience to determine which of your users will get the review prompt.

  2. Finally, edit the Display trigger settings to determine when this message will be displayed to these users.

1532

❗️

Important Note

Per Apple's documentation, you can only prompt a user to review your app up to three times in one year (365 days). This is something controlled on the iOS side and is one determination whether the display will prompt to the end user.

Additionally, each user has the ability to toggle whether they receive App Review prompts via the "In-App Ratings & Reviews" setting.

If either of these cases, the prompt would not display to the user, even if we request it.

Android Review Request Setup

The Leanplum App Rating for Android is implemented using the In-App Review API of the Play Core SDK.

To set up your project for an app rating, you need to copy the below code to your codebase and call the AppRating.register() method before Leanplum.start() is called:

package com.leanplum.customtemplates;

import android.app.Activity;
import com.google.android.play.core.review.ReviewInfo;
import com.google.android.play.core.review.ReviewManager;
import com.google.android.play.core.review.ReviewManagerFactory;
import com.google.android.play.core.tasks.Task;
import com.leanplum.ActionArgs;
import com.leanplum.ActionContext;
import com.leanplum.Leanplum;
import com.leanplum.LeanplumActivityHelper;
import com.leanplum.callbacks.ActionCallback;
import com.leanplum.callbacks.PostponableAction;

/**
 * Registers a Leanplum action that show the app rating flow for Google Play Store.
 */
public class AppRating {

  private static final String ACTION = "Request App Rating";

  public static void register() {
    Leanplum.defineAction(
        ACTION,
        Leanplum.ACTION_KIND_ACTION,
        new ActionArgs(),
        new ActionCallback() {
          @Override
          public boolean onResponse(ActionContext context) {
            LeanplumActivityHelper.queueActionUponActive(
                new PostponableAction() {
                  @Override
                  public void run() {
                    requestAppRating();
                  }
                });
            return true;
          }
        });
  }

  private static void requestAppRating() {
    Activity activity = LeanplumActivityHelper.getCurrentActivity();
    if (activity == null || activity.isFinishing())
      return;

    ReviewManager manager = ReviewManagerFactory.create(activity);
    Task<ReviewInfo> request = manager.requestReviewFlow();

    request.addOnCompleteListener(requestTask -> {
      if (!requestTask.isSuccessful()) {
        // There is a problem. Probably Google Play Store is missing.
        // If you need the exception call requestTask.getException().
        return;
      }

      Task<Void> flow = manager.launchReviewFlow(activity, requestTask.getResult());
      flow.addOnCompleteListener((reviewTask) -> {
        // The flow has finished. The API does not indicate whether the user
        // reviewed or not, or even whether the review dialog was shown.
      });
    });
  }
}

Note: Include the dependency for the Play Core Library into your Android project's Gradle file:

// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Ensure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:core:1.8.2'
}

🚧

Supported Android devices

According to Google Documentation, the follow devices are able to receive an App Rating request:

  • 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 Google Play Store installed

How To: Set Up an Android App Rating In Leanplum

Here's how to set up a message that triggers the App Review prompt:

  1. Create a new in-app campaign and select the Confirm template.
2040
  1. Set up the message's title and text with your custom rating request, and change the text of the Accept and Cancel buttons to fit your rating message.

  2. Set the Accept Action to Request App Rating.

605
  1. Edit the Audience to determine which of your users will get the review prompt.

  2. Finally, edit the Display trigger settings to determine when this message will be displayed to these users.

1532

Best Practice Example

To see an effective app review request message flow, see our guide to get more five-star app ratings.