Skip to content

Instantly share code, notes, and snippets.

@jawinn
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jawinn/a0451ac1354180a5f3f8 to your computer and use it in GitHub Desktop.
Save jawinn/a0451ac1354180a5f3f8 to your computer and use it in GitHub Desktop.
Rate app button, cross-platform app
// RATE APP LINK
$('#rate-app').on('click', function(e) {
// Find device platform using the plugin org.apache.cordova.device
var devicePlatform = device.platform;
// Check which platform
if (devicePlatform == "iOS") {
window.open('https://itunes.apple.com/us/app/YOUR-APP-SLUG-HERE/id000000000?mt=8&uo=4'); // or itms://
} else if (devicePlatform == "Android") {
window.open('market://details?id=com.YOUR.PACKAGENAME');
} else if (devicePlatform == "BlackBerry"){
window.open('http://appworld.blackberry.com/webstore/content/<applicationid>');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment