cordova-plugin-apprate
Version:
This plugin provide the rate this app functionality into your Cordova/Phonegap application<br>
230 lines (223 loc) • 10.6 kB
HTML
<html>
<head>
<meta charset='UTF-8'>
<title>Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='../'>
../
</a>
»
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
»
<span class='title'>README.md</span>
</div>
</div>
<div id='content'>
<nav class='toc'>
<p class='title'>
<a class='hide_toc' href='#'>
<strong>Table of Contents</strong>
</a>
<small>
(<a class='float_toc' href='#'>left</a>)
</small>
</p>
</nav>
<div id='filecontents'>
<h1 id="apprate-cordova-phonegap-plugin">AppRate Cordova/Phonegap plugin</h1><p>This plugin provide the rate this app functionality into your Cordova/Phonegap application<br></p><p>Issues list and features requests <a href="https://github.com/pushandplay/cordova-plugin-apprate/issues?state=open">here</a></p><p><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=MS8RQAS2NVVQW&lc=RU&item_name=github%2ecom&item_number=cordova%2dplugin%2dapprate&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">Donate with PayPal</a></p><p><img src="https://dl.dropboxusercontent.com/u/26238/Cordova/Plugins/AppRate/preview_iPad.png" width="100%" alt="Preview iPad"/></p><h3 id="read-before-implementation">Read before implementation</h3>
<ul>
<li><a href="http://www.loopinsight.com/2014/02/04/begging-for-app-ratings/">Begging For App Ratings</a></li>
<li><a href="http://bitsplitting.org/2013/12/11/choices-and-consequences/">Choices And Consequences</a></li>
<li><a href="http://www.cowlyowl.com/blog/app-store-reviews">The importance of App Store reviews</a></li>
<li><a href="http://blog.edovia.com/2014/01/03/the-rate-friday-initiative/">The Rate Friday Initiative</a></li>
<li><a href="http://dancounsell.com/articles/prompting-for-app-reviews">Prompting for App Reviews</a></li>
</ul>
<h3 id="read-before-writing-review">Read before writing review</h3>
<ul>
<li><a href="https://github.com/pushandplay/cordova-plugin-apprate/wiki">FAQ</a></li>
</ul>
<h2 id="supported-platforms">Supported platforms</h2>
<ul>
<li>iOS</li>
<li>Android</li>
<li>Blackberry (experimental)</li>
<li>Windows8 (experimental)</li>
</ul>
<h2 id="requirements">Requirements</h2><p>Phonegap / Cordova 3.0.0 or later</p><h2 id="installation">Installation</h2>
<ul>
<li><p>From github repository:</p><p> cordova plugins add <a href="https://github.com/pushandplay/cordova-plugin-apprate.git">https://github.com/pushandplay/cordova-plugin-apprate.git</a></p></li>
<li><p>From apache cordova plugins registry:</p><p> cordova plugins add org.pushandplay.cordova.apprate</p></li>
<li><p>From phonegap build add the following to your config.xml:</p> <gap:plugin name="org.pushandplay.cordova.apprate" />
</li>
</ul>
<h2 id="customization-and-usage">Customization and usage</h2>
<h4 id="note">Note</h4><p>All %@ patterns in customLocale object will be automatically replaced to your application title</p><h4 id="available-preferences-options">Available preferences options</h4>
<pre><code>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.blackberry {String} null - application URL in AppWorld
storeAppURL.windows8 {String} null - application URL in WindowsStore
customLocale {Object} null - custom locale object
</code></pre><h2 id="examples">Examples</h2>
<h4 id="simple-setup-and-call">Simple setup and call</h4>
<pre><code>AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.preferences.storeAppURL.blackberry = 'appworld://content/[App Id]/';
AppRate.preferences.storeAppURL.windows8 = 'ms-windows-store:Review?name=<the Package Family Name of the application>';
AppRate.promptForRating();
</code></pre><h4 id="call-rate-dialog-immediately">Call rate dialog immediately</h4>
<pre><code>AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.promptForRating(true);
</code></pre><h4 id="override-dialog-button-callback">Override dialog button callback</h4>
<pre><code>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();
</code></pre><h4 id="set-custom-language">Set custom language</h4>
<pre><code>AppRate.preferences.useLanguage = 'ru';
AppRate.preferences.storeAppURL.ios = '<my_app_id>';
AppRate.preferences.storeAppURL.android = 'market://details?id=<package_name>';
AppRate.promptForRating();
</code></pre><h4 id="set-custom-locale-object">Set custom Locale object</h4>
<pre><code>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();
</code></pre><h4 id="full-setup">Full setup</h4>
<pre><code>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.openStoreInApp = true;
AppRate.preferences.storeAppURL.ios = '<my_app_id>';
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();
</code></pre><h4 id="callbacks-setup-and-use-custom-rate-dialog">Callbacks setup and use custom rate-dialog</h4>
<pre><code>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);
</code></pre><h2 id="already-included-translations">Already included translations</h2><p>ar, bn, ca, cs, da, de, de-AT, el, en, es, fa, fr, he, hi, id, il, ja, ko, nl, no, pa, pl, pt, ru, sk, sl, sv, th, tr, uk, ur, ur-IN, ur-PK, vi, zh-TW, zh-Hans, zh-Hant</p><h4 id="access-to-locales">Access to locales</h4>
<pre><code>// Getting list of names for available locales
AppRate.locales.getLocalesNames();
// Getting locale object by name
AppRate.locales.getLocale('en');
</code></pre><p>You can add a new translation here: <a href="https://crowdin.net/project/apprate-cordovaphonegap-plugin">https://crowdin.net/project/apprate-cordovaphonegap-plugin</a></p><h2 id="licence">Licence</h2><p>The Apache 2.0 License</p>
</div>
</div>
<div id='footer'>
February 07, 15 14:33:53 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
✲
Press H to see the keyboard shortcuts
✲
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
✲
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>