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");
});

803d79903d70796895388f80c91ad927
About Namrata Ukirde

I am ROR developer, Passionate about learning new things. Love to write poems.

3 Comments

  • 5c25416d516fe5dfdc6a9ab3c9242bd7

    ashok 11-Jul-2017 · Reply

    can you tell me how to call this plugin i dont unerstant

  • Bba334f31c80b3ba8bd30d661c478b79

    Nikhil 18-Jul-2017 · Reply

    This does redirect user to beginning of Play store page but not where user has to actually rate the app. Is there a way to do it?

Your comment

*

*