Many times App's rate and reviews decides app's success. Reviews by user's are important part of app and decides what are good things about our app and what improvements are needed.

Now a days its common to provide Rate & Review button or link that will redirect to app store or play store.

If we have cordova app then we can simply do it in following way using js. We can identify whether device is android or ios and accordingly open it in window.

$('#rate-app').on('click', function(e) {    
  if (iosDevice) {
      window.open('https://itunes.apple.com/us/app/YOUR-APP-SLUG-HERE/id000000000?mt=8&uo=4'); // or itms://
  } else if (androidDevice) {
      window.open('market://details?id=com.YOUR.PACKAGENAME');
  } 
});

This opens in browser window. If we want to open our app in playstore app itself then we can do it using cordova-launch-review plugin.

Steps:

  • add plugin: cordova plugin add cordova-launch-review
  • add plugin name to config.xml if you are using ember: <plugin name="cordova-launch-review" spec="1.0.3" />
  • The plugin is exposed via the LaunchReview object and provides a single function launch() which launches the store app using the given app ID: LaunchReview.launch(appId, successCallback);

Example:

var appId, platform = device.platform.toLowerCase();

switch(platform){
    case "ios":
        appId = "585027354";
        break;
    case "android":
        appId = "com.google.android.apps.maps";
        break;
}

LaunchReview.launch(appId, function(){
    console.log("Successfully launched store app");
});