I am using org.pushandplay.cordova.apprate with XDK for Android. It just does not work. Maybe it's a syntax problem, but I cannot figure it out. I have already searched quite some forums with not sufficient answer.
Here's how I did it:
I installed the org.pushandplay.cordova.apprate plugin, newest version.
I put the following code in the file js/app.js:
function rateButton() {
var customLocale = {};
customLocale.title = "Rate this App";
customLocale.message = "Rate this App 5 star if you found it useful!";
customLocale.cancelButtonLabel = "No, Thanks";
customLocale.laterButtonLabel = "Remind Me Later";
customLocale.rateButtonLabel = "Rate It Now";
AppRate.preferences.openStoreInApp = true;
AppRate.preferences.storeAppURL.android = 'market://details?id=com.my.project';
AppRate.preferences.customLocale = customLocale;
AppRate.preferences.displayAppName = 'My Project';
AppRate.preferences.usesUntilPrompt = 1;
AppRate.preferences.promptAgainForEachNewVersion = false;
AppRate.promptForRating(true);
};
In the html file I put the following:
<button onclick="rateButton()" class="btn btn-primary" type="submit">Rate the app</button>
When I click on the button (within the built app) nothing happens. Do I have to indicate where to find the function? I must admit that I am not quite familiar with Javascript Syntax, but I studied some guides and I couldn't find my mistake.