Class: AppRate

TypeScript defined in: typescript/AppRate.d.ts
CoffeeScript defined in: www_src/AppRate.coffee

Overview

Note: All %@ patterns in customLocale object will be automatically replaced to your application title

AppRate plugin base class

Examples:

Simple setup and call

AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.promptForRating();

Call rate dialog immediately

AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.promptForRating(true);

Override dialog button callback

var onButtonClicked = function(buttonIndex) {
  console.log("onButtonClicked -> " + buttonIndex);
};
AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.preferences.callbacks.onButtonClicked = onButtonClicked;
AppRate.promptForRating();

Set custom language

AppRate.preferences.useLanguage = 'ru';
AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.promptForRating();

Set custom Locale object

var customLocale = {};
customLocale.title = "Rate %@";
customLocale.message = "If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!";
customLocale.cancelButtonLabel = "No, Thanks";
customLocale.laterButtonLabel = "Remind Me Later";
customLocale.rateButtonLabel = "Rate It Now";

AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.preferences.customLocale = customLocale;
AppRate.promptForRating();

Full setup

var customLocale = {};
customLocale.title = "Rate %@";
customLocale.message = "If you enjoy using %@, would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!";
customLocale.cancelButtonLabel = "No, Thanks";
customLocale.laterButtonLabel = "Remind Me Later";
customLocale.rateButtonLabel = "Rate It Now";

AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.openStoreInApp = true;
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.preferences.customLocale = customLocale;
AppRate.preferences.displayAppName = 'My custom app title';
AppRate.preferences.usesUntilPrompt = 5;
AppRate.preferences.promptAgainForEachNewVersion = false;
AppRate.promptForRating();

Callbacks setup and use custom rate-dialog

var onRateDialogShow = function(callback) {
  console.log("onRateDialogShow");
  // call this callback when user click on button into your custom rate-dialog
  // for example: simulate click on "Rate now" button and display store
  callback(3)
};
var onButtonClicked = function(buttonIndex) {
  console.log("onButtonClicked -> " + buttonIndex);
};

AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.useCustomRateDialog = true;
AppRate.preferences.callbacks.onRateDialogShow = onRateDialogShow;
AppRate.preferences.callbacks.onButtonClicked = onButtonClicked;

// True param show rate-dialog immediately and useful for testing or custom logic
AppRate.promptForRating(true);

Variables Summary

locales =
Locales
preferences =
{
  useLanguage: null,
  displayAppName: '',
  promptAgainForEachNewVersion: true,
  usesUntilPrompt: 3,
  openStoreInApp: false,
  useCustomRateDialog: false,
  callbacks: {
    onButtonClicked: null,
    onRateDialogShow: null
  },
  storeAppURL: {
    ios: null,
    android: null,
    blackberry: null,
    windows8: null
  },
  customLocale: null
}

Class Method Summary

Class Method Details

. (AppRate) init()

Initialize

Returns:

. (AppRate) promptForRating(immediately = false)

Check plugin preferences and display or not display rate popup

Examples:

AppRate.promptForRating();

Parameters:

  • immediately ( Boolean ) open rate dialog immediately

Returns:

Open application page in store

Returns:

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: