urz0r
urz0r

Reputation: 462

Android: Open Play Store links from PhoneGap app

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!

Upvotes: 4

Views: 2983

Answers (2)

urz0r
urz0r

Reputation: 462

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.

Upvotes: 1

user1990252
user1990252

Reputation:

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.

Upvotes: 1

Related Questions