How to: Show Rating Popups Whenever You Want

Posted on 24. July 2024 by Jan Bunk


Are you looking for general information and screenshots? Please check out our main article about review reminders.

By default, your app will ask users to leave a review in the app stores a couple days after installation if they have opened the app several times by then. Do you want to customize this? Use our JavaScript API!

Here are some of the benefits of showing the review reminder manually:

  • You can show the review reminder after the user got value from your app and is happy about it and therefore more likely to leave a positive review.
  • You can avoid showing the review reminder while the user is in the middle of a task where they don't want to be interrupted.
  • You can use your data to show the review reminder only to your most satisfied customers.

You might want to disable the automatic review reminders if you'll be triggering them manually now.

Using the JavaScript Function

You might want to check out the executeWhenAppReady() function of our app helper script. It ensures that your website doesn't try to interact with the app before it's ready or when your website is loaded using a regular browser (ReferenceError, function is not defined).

showReviewReminder

Use this function to show the review reminder. If you're not using the native review reminder, it will return the button that the user clicked.


<script>
    try {
        let useNativeReviewReminder = false;
        // These are the default texts. If you don't want to change them, you can also pass null and the app will
        // default to them.
        let title = "Please rate us!";
        let message = "If you like this app, please take a minute of your time and leave us a positive review! It helps us out a ton. Thank you for your generosity!";
        let rateButton = "Rate";
        let noButton = "No thanks";
        let laterButton = "Remind me later";
        
        let clickedButton = (await showReviewReminder(useNativeReviewReminder, title, message, rateButton, noButton, laterButton))["clickedButton"];
        
        switch (clickedButton) {
            case "rate":
                // The user clicked the button to rate the app.
                break;
            case "later":
                // The user clicked the button to be reminded later.
                break;
            case "no":
                // The user doesn't want to rate the app.
                break;
        }
    }
    catch (e) {
        // Can occur if:
        // - the app couldn't connect to the native code. Should be very unlikely.
        console.log(e);
    }
</script>
    

If you want to show the native review reminder dialog, only the first argument matters. Make sure to still pass a value for the other arguments though (even though their value is irrelevant).


<script>
    try {
        let useNativeReviewReminder = true;
        await showReviewReminder(useNativeReviewReminder, null, null, null, null, null);
    }
    catch (e) {
        // Can occur if:
        // - the app couldn't connect to the native code. Should be very unlikely.
        console.log(e);
    }
</script>
    

Please keep in mind that the native review reminder is not guaranteed to show up. Here are potential reasons why it might not show up:

  • The user has already been shown the dialog within the past month (on Android) or more than 3 times in the past 365 days (on iOS).
  • The user has already rated the app.
  • Your app is not yet published in the platform's app store.

Unfortunately there is also no way to programmatically check if the native review reminder was shown.

Due to these limitations, I'd recommend that you test your code with the non-native dialog, where you can be sure that it will be displayed.