Gathering detailed insights and metrics for cordova-plugin-apprate
Gathering detailed insights and metrics for cordova-plugin-apprate
Gathering detailed insights and metrics for cordova-plugin-apprate
Gathering detailed insights and metrics for cordova-plugin-apprate
npm install cordova-plugin-apprate
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
298 Stars
308 Commits
191 Forks
16 Watching
2 Branches
47 Contributors
Updated on 28 Oct 2024
JavaScript (80.83%)
Objective-C (11.73%)
Java (7.44%)
Cumulative downloads
Total Downloads
Last day
12.5%
817
Compared to previous day
Last week
-9.6%
4,004
Compared to previous week
Last month
-6.9%
19,109
Compared to previous month
Last year
-3.4%
263,844
Compared to previous year
2
A plugin to provide rate this app functionality into your cordova application
PR's are greatly appreciated
Choose your preferred browser plugin which will be used to open the store and install it:
You must implement the openUrl
method for your chosen plugin. Below is an example that works for both.
1AppRate.setPreferences({ 2 openUrl: function(url) { 3 var safariAvailable = false; 4 5 if (window.SafariViewController) { 6 SafariViewController.isAvailable(function(available) { 7 safariAvailable = available; 8 }); 9 } 10 11 if (!safariAvailable) { 12 window.open(url, '_blank', 'location=yes'); 13 } else { 14 SafariViewController.show( 15 { 16 url: url, 17 barColor: "#0000ff", // on iOS 10+ you can change the background color as well 18 controlTintColor: "#00ffff", // on iOS 10+ you can override the default tintColor 19 tintColor: "#00ffff", // should be set to same value as controlTintColor and will be a fallback on older ios 20 }, 21 22 // this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed' 23 function(result) { 24 console.log(result.event) 25 }, 26 27 function(msg) { 28 console.log("Error: " + msg); 29 } 30 ); 31 } 32 } 33});
cordova plugin add cordova-plugin-apprate
cordova plugin add https://github.com/pushandplay/cordova-plugin-apprate.git
<gap:plugin name="cordova-plugin-apprate" />
To set up Play In-App Reviews Library version, you can use PLAY_REVIEW_VERSION parameter (with 2.+
value by default). It is useful in order to avoid conflicts with another plugins which use any other different version of Play In-App Reviews Library. For Play In-App Reviews Library release notes please see https://developer.android.com/reference/com/google/android/play/core/release-notes-in_app_reviews
These options are available to set via the setPreferences
method.
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 |
reviewType.ios | Enum | AppStoreReview | the type of review display to show the user on iOS |
reviewType.android | Enum | InAppBrowser | the type of review display to show the user on Android |
simpleMode | Boolean | false | enabling simplemode would display the rate dialog directly without the negative feedback filtering flow |
showPromptForInAppReview | boolean | true | disabling would skip displaying a rate dialog if in app review is set and available |
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 |
InAppReview
- Write review directly in your application (iOS 10.3+), limited to 3 prompts per year. Will fallback to 'AppStoreReview' for other iOS versionsAppStoreReview
- Open the store within the app. Use this option as an alternative to inAppReview to avoid the rate action from doing nothingInAppBrowser
- Open the store using the openUrl
preference (defaults to InAppBrowser). Be advised that WKWebView might not open the app store linksInAppReview
- Write review directly in your application. Will fallback to InAppBrowser
if not availableInAppBrowser
- Open the store using the openUrl
preference (defaults to InAppBrowser)The InAppReview
review type will attempt to launch a native in-app review dialog (as opposed to opening the app store).
The native dialog is designed to maintain the privacy of the users and to prevent applications from harassing them with too many review requests. As such, the dialog might or might not appear, and we will not be able to know whether it appeared, or whether the user reviewed the app or not.
Since we can't know if the dialog will be shown, and in order to comply to the requirements of Apple/Android, no custom prompt will be shown to the user before attempting to open the in-app review dialog.
Native in-app review can only be possible under certain conditions. If those conditions are not met, a fallback method will be used see information per platform.
Note: The InAppReview
will only work on released versions. To test it our please refer to this article
Makes sure all your calls to the plugin happen after the cordova onDeviceReady
event has fired.
Note: windows does not need an URL as this is done by the native code.
1AppRate.setPreferences({ 2 storeAppURL: { 3 ios: '<my_app_id>', 4 android: 'market://details?id=<package_name>', 5 blackberry: 'appworld://content/[App Id]/', 6 windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>' 7 } 8}); 9 10AppRate.promptForRating();
1AppRate.promptForRating(false);
If false is not present it will ignore usesUntilPrompt
, promptAgainForEachNewVersion
, and the button logic, it will prompt every time.
1AppRate.setPreferences({ 2 callbacks: { 3 onButtonClicked: function(buttonIndex) { 4 console.log("onButtonClicked -> " + buttonIndex); 5 } 6 } 7});
1AppRate.setPreferences({ 2 useLanguage: 'ru' 3});
Note: %@
patterns in title
and message
will be automatically replaced with preferences.displayAppName
1AppRate.setPreferences({ 2 customLocale: { 3 title: "Would you mind rating %@?", 4 message: "It won’t take more than a minute and helps to promote our app. Thanks for your support!", 5 cancelButtonLabel: "No, Thanks", 6 laterButtonLabel: "Remind Me Later", 7 rateButtonLabel: "Rate It Now", 8 yesButtonLabel: "Yes!", 9 noButtonLabel: "Not really", 10 appRatePromptTitle: 'Do you like using %@', 11 feedbackPromptTitle: 'Mind giving us some feedback?', 12 } 13});
1AppRate.setPreferences({ 2 displayAppName: 'My custom app title', 3 usesUntilPrompt: 5, 4 promptAgainForEachNewVersion: false, 5 reviewType: { 6 ios: 'AppStoreReview', 7 android: 'InAppBrowser' 8 }, 9 storeAppURL: { 10 ios: '<my_app_id>', 11 android: 'market://details?id=<package_name>', 12 windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>', 13 blackberry: 'appworld://content/[App Id]/', 14 windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>' 15 }, 16 customLocale: { 17 title: "Would you mind rating %@?", 18 message: "It won’t take more than a minute and helps to promote our app. Thanks for your support!", 19 cancelButtonLabel: "No, Thanks", 20 laterButtonLabel: "Remind Me Later", 21 rateButtonLabel: "Rate It Now", 22 yesButtonLabel: "Yes!", 23 noButtonLabel: "Not really", 24 appRatePromptTitle: 'Do you like using %@', 25 feedbackPromptTitle: 'Mind giving us some feedback?', 26 }, 27 callbacks: { 28 handleNegativeFeedback: function(){ 29 window.open('mailto:feedback@example.com', '_system'); 30 }, 31 onRateDialogShow: function(callback){ 32 callback(1) // cause immediate click on 'Rate Now' button 33 }, 34 onButtonClicked: function(buttonIndex){ 35 console.log("onButtonClicked -> " + buttonIndex); 36 } 37 }, 38 openUrl: function(url) { 39 var safariAvailable = false; 40 41 if (window.SafariViewController) { 42 SafariViewController.isAvailable(function(available) { 43 safariAvailable = available; 44 }); 45 } 46 47 if (!safariAvailable) { 48 window.open(url, '_blank', 'location=yes'); 49 } else { 50 SafariViewController.show( 51 { 52 url: url, 53 barColor: "#0000ff", // on iOS 10+ you can change the background color as well 54 controlTintColor: "#00ffff", // on iOS 10+ you can override the default tintColor 55 tintColor: "#00ffff", // should be set to same value as controlTintColor and will be a fallback on older ios 56 }, 57 58 // this success handler will be invoked for the lifecycle events 'opened', 'loaded' and 'closed' 59 function(result) { 60 console.log(result.event) 61 }, 62 63 function(msg) { 64 console.log("Error: " + msg); 65 } 66 ); 67 } 68 } 69}); 70 71AppRate.promptForRating();
1AppRate.setPreferences({ 2 displayAppName: 'My custom app title', 3 usesUntilPrompt: 5, 4 promptAgainForEachNewVersion: false, 5 reviewType: { 6 ios: 'AppStoreReview', 7 android: 'InAppBrowser' 8 }, 9 storeAppURL: { 10 ios: '<my_app_id>', 11 android: 'market://details?id=<package_name>', 12 windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>', 13 blackberry: 'appworld://content/[App Id]/', 14 windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>' 15 }, 16 customLocale: { 17 title: "Would you mind rating %@?", 18 message: "It won’t take more than a minute and helps to promote our app. Thanks for your support!", 19 cancelButtonLabel: "No, Thanks", 20 laterButtonLabel: "Remind Me Later", 21 rateButtonLabel: "Rate It Now", 22 yesButtonLabel: "Yes!", 23 noButtonLabel: "Not really", 24 appRatePromptTitle: 'Do you like using %@', 25 feedbackPromptTitle: 'Mind giving us some feedback?', 26 }, 27 callbacks: { 28 handleNegativeFeedback: function(){ 29 window.open('mailto:feedback@example.com', '_system'); 30 }, 31 onRateDialogShow: function(callback){ 32 callback(1) // cause immediate click on 'Rate Now' button 33 }, 34 onButtonClicked: function(buttonIndex){ 35 console.log("onButtonClicked -> " + buttonIndex); 36 } 37 } 38}); 39 40AppRate.promptForRating();
1// Getting list of names for available locales 2AppRate.locales.getLocalesNames(); 3 4// Getting locale object by name 5AppRate.locales.getLocale('en');
Currently maintained by @westonganger
Created by @pushandplay
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/23 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More