GithubHelp home page GithubHelp logo

jon-moreira / cordova-plugin-apprate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pushandplay/cordova-plugin-apprate

0.0 2.0 0.0 353 KB

This plugin provide the "rate this app" functionality into your Cordova/Phonegap application

License: Apache License 2.0

Java 4.18% Objective-C 11.93% JavaScript 83.89%

cordova-plugin-apprate's Introduction

cordova-plugin-apprate

This plugin provide the rate this app functionality into your Cordova/Phonegap application

Donate with PayPal

PR's are greatly appreciated. If your interested in maintainer status please create a couple PR's and then contact [email protected]

Preview iPad

Some Articles on the Importance of App Reviews and Ratings

Supported platforms

  • iOS
  • Android
  • Windows (experimental)
  • Blackberry (experimental)
  • Windows8 (experimental)

Requirements

Phonegap / 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

Note

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

Available preferences options

Option Type Default Description
useLanguage {String} null custom BCP 47 language tag
displayAppName {String} '' custom application title
promptAgainForEachNewVersion {Boolean} true show dialog again when application version will be updated
usesUntilPrompt {Integer} 3 count of runs of application before dialog will be displayed
openStoreInApp {Boolean} false leave app or no when application page opened in app store (now supported only for iOS)
useCustomRateDialog {Boolean} false use custom view for rate dialog
callbacks.onButtonClicked {Function} null call back function. called when user clicked on rate-dialog buttons
callbacks.onRateDialogShow {Function} null call back function. called when rate-dialog showing
storeAppURL.ios {String} null application id in AppStore
storeAppURL.android {String} null application URL in GooglePlay
storeAppURL.windows {String} null application URL in Windows Store
storeAppURL.blackberry {String} null application URL in AppWorld
storeAppURL.windows8 {String} null application URL in WindowsStore
customLocale {Object} null custom locale object

Examples

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);
    }
  }
};

Already included translations

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

Access to locales

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

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

cordova-plugin-apprate's People

Contributors

pushandplay avatar westonganger avatar luigi37 avatar fpmweb avatar akofman avatar mikeboht avatar amuramoto avatar ersingencturk avatar joshuahotz avatar markarja avatar krysalead avatar rodrigograca31 avatar rgksugan avatar

Watchers

James Cloos avatar Jonas Moreira avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.