New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-apprate

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-apprate

A plugin to provide rate this app functionality into your Cordova / Phonegap application

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
decreased by-3.71%
Maintainers
2
Weekly downloads
 
Created
Source

Cordova-Plugin-Apprate

A plugin to provide rate this app functionality into your Cordova / Phonegap application

Donate with PayPal

PR's are greatly appreciated

Supported platforms

  • iOS
  • Android
  • Windows
  • Blackberry

Requirements

Cordova 3.0.0 or later

Installation

  • From apache cordova plugins registry: cordova plugins add cordova-plugin-apprate
  • From github repository: cordova plugins add https://github.com/pushandplay/cordova-plugin-apprate.git
  • From phonegap build add the following to your config.xml: <gap:plugin name="cordova-plugin-apprate" />

Customization and usage

Options / Preferences

These options are available on the AppRate.preferences object.

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

OptionTypeDefaultDescription
useLanguageStringnullcustom BCP 47 language tag
displayAppNameString''custom application title
promptAgainForEachNewVersionBooleantrueshow dialog again when application version will be updated
usesUntilPromptInteger3count of runs of application before dialog will be displayed
openStoreInAppBooleanfalseleave app or no when application page opened in app store (now supported only for iOS)
useCustomRateDialogBooleanfalseuse custom view for rate dialog
callbacks.onButtonClickedFunctionnullcall back function. called when user clicked on rate-dialog buttons
callbacks.onRateDialogShowFunctionnullcall back function. called when rate-dialog showing
storeAppURL.iosStringnullapplication id in AppStore
storeAppURL.androidStringnullapplication URL in GooglePlay
storeAppURL.windowsStringnullapplication URL in Windows Store
storeAppURL.blackberryStringnullapplication URL in AppWorld
storeAppURL.windows8Stringnullapplication URL in WindowsStore
customLocaleObjectnullcustom locale object

Examples

Makes sure all your calls to the plugin happen after the cordova onDeviceReady event has fired.

Simple setup and call

AppRate.preferences.storeAppURL = {
  ios: '<my_app_id>',
  android: 'market://details?id=<package_name>',
  windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>',
  blackberry: 'appworld://content/[App Id]/',
  windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>'
};

AppRate.promptForRating();

Don't Call rate dialog immediately

AppRate.promptForRating(false);

If false is not present it will ignore usesUntilPrompt, promptAgainForEachNewVersion, and button logic, it will prompt every time.

Override dialog button callback

AppRate.preferences.callbacks.onButtonClicked = function(buttonIndex) {
  console.log("onButtonClicked -> " + buttonIndex);
};

Set custom language

AppRate.preferences.useLanguage = 'ru';

Set custom Locale object

AppRate.preferences.customLocale = {
  title: "Rate %@",
  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!",
  cancelButtonLabel: "No, Thanks",
  laterButtonLabel: "Remind Me Later",
  rateButtonLabel: "Rate It Now"
};

Full setup

AppRate.preferences = {
  openStoreInApp: true,
  displayAppName: 'My custom app title',
  usesUntilPrompt: 5,
  promptAgainForEachNewVersion: false,
  storeAppURL: {
    ios: '<my_app_id>',
    android: 'market://details?id=<package_name>',
    windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>',
    blackberry: 'appworld://content/[App Id]/',
    windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>'
  },
  customLocale: {
    title: "Rate %@",
    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!",
    cancelButtonLabel: "No, Thanks",
    laterButtonLabel: "Remind Me Later",
    rateButtonLabel: "Rate It Now"
  }
};

AppRate.promptForRating();

Callbacks setup and use custom rate-dialog

AppRate.preferences = {
  useCustomRateDialog: true,
  callbacks: {
    onRateDialogShow: function(callback){
      callback(1) // cause immediate click on 'Rate Now' button
    },
    onButtonClicked: function(buttonIndex){
      console.log("onButtonClicked -> " + buttonIndex);
    }
  }
};

Access to locales

// Getting list of names for available locales
AppRate.locales.getLocalesNames();

// Getting locale object by name
AppRate.locales.getLocale('en');

List of translations

https://github.com/pushandplay/cordova-plugin-apprate/blob/master/www/locales.js

Credits

Currently maintained by @westonganger

Created by @pushandplay

FAQs

Package last updated on 09 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc