问题
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!
回答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.
回答2:
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.
来源:https://stackoverflow.com/questions/22501977/android-open-play-store-links-from-phonegap-app