Android: Open Play Store links from PhoneGap app

爷,独闯天下 提交于 2019-12-12 12:07:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!