Rate this app in Ionic application

You may need a "Rate this app" link inside your Ionic Framework Android and iOS application. When I implemented this features by adding the link to Google Play and App Store, the link does not work. Then I found that it needs inappbrowser cordova plugin.

Add InApp Browser cordova plugin

cordova plugin add org.apache.cordova.inappbrowser

Implement "Rate this app"

Now, go ahead and start creating method to open a link based on the device.

<button ng-click="rateUs()">Rate us</button>
$scope.rateUs = function () {
    if ($ionicPlatform.is('ios')) {
        window.open('itms-apps://itunes.apple.com/us/app/domainsicle-domain-name-search/id511364723?ls=1&mt=8'); // or itms://
    } else if ($ionicPlatform.is('android')) {
        window.open('market://details?id=<package_name>');
    }
}

Have a nice day.

Vote on HN

comments powered byDisqus