4

I want to open a link to the google play store from my phonegap 3.4 app. Calling market://details?id=com.google.android.apps.maps leads to an ActivityNotFoundException which is defined here:

https://github.com/apache/cordova-android/blob/af440460e10da89caa167ecb5c266f3857493f90/framework/src/org/apache/cordova/CordovaWebViewClient.java#L208

What do I have to change so that the activity which should handle the intent is found? any help is appreciated!

urz0r
  • 462
  • 3
  • 8

2 Answers2

1

That is very easy and I wrote a plugin for PhoneGap for that. Check out this blogpost of mine.

When you have added the plugin, all you need to do to open the store is this:

appstore("org.teusink.droidpapers", "app");

appstore("Teusink.org", "pub");

Additional note, also support for Amazon Appstore in that plugin.

  • Could you add support for opening the stores for iOS and Windows Phone as well? – andreszs Jan 02 '15 at 16:43
  • Sorry, that won't happen by me (lack of time and knowledge on that part). You are free to develop the iOS and Windows Phone parts and use the Javascript and Cordova code I made. Should not be that hard. –  Jan 04 '15 at 16:03
1

I'm gonna answer my own question:

Turns out the code was perfectly fine but Google Play Store wasn't installed on the simulator that I was using. On a real device with the Google Play Store App installed, everything was working.

urz0r
  • 462
  • 3
  • 8