App Rate
The AppRate plugin makes it easy to prompt the user to rate your app, either now, later, or never.
Requires Cordova plugin: cordova-plugin-apprate. For more info, please see the AppRate plugin docs.
Repo: https://github.com/pushandplay/cordova-plugin-apprate
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-apprate $ npm install --save @ionic-native/app-rate@4 - Add this plugin to your app's module
Supported platforms
- Android
- BlackBerry 10
- iOS
- Windows
Usage
import { AppRate } from '@ionic-native/app-rate';
constructor(private appRate: AppRate) { }
...
// set certain preferences
this.appRate.preferences.storeAppURL = {
ios: '<app_id>',
android: 'market://details?id=<package_name>',
windows: 'ms-windows-store://review/?ProductId=<store_id>'
};
this.appRate.promptForRating(true);
// or, override the whole preferences object
this.appRate.preferences = {
usesUntilPrompt: 3,
storeAppURL: {
ios: '<app_id>',
android: 'market://details?id=<package_name>',
windows: 'ms-windows-store://review/?ProductId=<store_id>'
}
};
this.appRate.promptForRating(false);
Instance Members
preferences
Configure various settings for the Rating View. See table below for options
promptForRating(immediately)
Prompts the user for rating
| Param | Type | Details |
|---|---|---|
| immediately |
boolean
|
Show the rating prompt immediately. |
navigateToAppStore()
Immediately send the user to the app store rating page
AppRatePreferences
| Param | Type | Details |
|---|---|---|
| useLanguage |
string
|
Custom BCP 47 language tag (optional) |
| displayAppName |
string
|
Custom application title (optional) |
| promptAgainForEachNewVersion |
boolean
|
Show dialog again when application version will be updated. Defaults to |
| usesUntilPrompt |
number
|
count of runs of application before dialog will be displayed. Defaults to |
| simpleMode |
boolean
|
Simple Mode to display the rate dialog directly and bypass negative feedback filtering flow (optional) |
| inAppReview |
boolean
|
leave app or no when application page opened in app store (now supported only for iOS). Defaults to |
| useCustomRateDialog |
boolean
|
use custom view for rate dialog. Defaults to |
| customLocale |
AppRateCustomLocale
|
Custom locale object (optional) |
| callbacks |
AppRateCallbacks
|
Callbacks for events (optional) |
| storeAppURL |
AppUrls
|
App Store URLS (optional) |
AppUrls
| Param | Type | Details |
|---|---|---|
| ios |
string
|
application id in AppStore (optional) |
| android |
string
|
application URL in GooglePlay (optional) |
| windows |
string
|
application URL in Windows Store (optional) |
| blackberry |
string
|
application URL in AppWorld (optional) |
| windows8 |
string
|
application URL in WindowsStore (optional) |
AppRateCallbacks
| Param | Type | Details |
|---|---|---|
| onButtonClicked |
Function
|
call back function. called when user clicked on rate-dialog buttons (optional) |
| onRateDialogShow |
Function
|
call back function. called when rate-dialog showing (optional) |
| handleNegativeFeedback |
Function
|
call back function. called when user clicked on negative feedback (optional) |