Provide a button to open the platforms market app

I would like to open the play store app from my ionic app. Is there a way to do this?
This doesn’t do anything.

<a href="market://details?id=com.abcd.xyz">

and this just opens the play store page inside the app

<a href="https://play.google.com/store/apps/details?id=com.abcd.xyz">

I would like the play store app to handle the store page, and not have it open inside my app.

I am currently on the beta 14 build.

1 Like

So for this, you could use cordova’s inappbrowser and ng-cordova.

 <ion-content>
     <button class="button" ng-click="openMarket('https://play.google.com/store/apps/details?id=com.abcd.xyz')">Open Market</button>
    </ion-content>

Controller

.controller('MyCtrl', function($scope, $cordovaInAppBrowserSource) {
  $scope.openMarket = function(src){
   $cordovaInAppBrowserSource.open(src, target, options) 
  }
});

http://ngcordova.com/docs/plugins/inAppBrowser/

2 Likes

Same way, I would like to open the App store application from my ionic app if app store is having upgraded version of my installed app. Is there a way to do this?

2 Likes

I know this is old, but I am trying to have a side menu item go directly to the app store (displaying apps posted by my company) when clicked. I tried using what you put and it is giving me this error ( https://docs.angularjs.org/error/$injector/unpr?p0=$cordovaInAppBrowserSourceProvider%20<-%20$cordovaInAppBrowserSource%20<-%20MenuCtrl ). I added the cordova plugin to the platform and am also including this . This is my first ionic (and cordova) app, so I am very new to this. I could not find a solution, so any help would be greatly appreciated! :smile:

Your link
<a href="market://details?id=com.abcd.xyz">
will open the PlayStoreApp if you add
<access origin="market:*" launch-external="yes"/>
to your config.xml.

5 Likes

Any answer about this???

:confused:

hey i tried to open application in google play store from ionic 2 application …but problem is that play store open in browser but i want to open play store application.

code that i used

InAppBrowser.open(‘https://play.google.com/store/apps/details?id=<pacakge_name>’,’_blank’,‘location=yes’);

Edit :
I found some api in ionic 2 but i didn’t get any succes… i got error
-page.ts(2,9): Error TS2305: Module '"D:/Varshil/CordovaProjects/NRA_Hybrid/node
_modules/ionic-native/dist/index"’ has no exported member ‘Market’.

please refer below link

http://ionicframework.com/docs/v2/native/market/