我正在尝试在App发明者WebView中打开应用商店中的应用链接。 html链接打开了Playstore网站的移动版本,但这不是我需要的。我需要链接在Google Play商店应用中打开应用。
此html页面嵌入在WebView中。然后用whatsapp App的例子
<a href="https://play.google.com/store/apps/details?id=com.whatsapp">Buy it now</a>
我也试过market://
但它不起作用。
使用webviewer组件的WebViewString属性将URL传递回App Inventor。然后使用活动入门者在Google Play中打开该应用。
How does the property Webviewer.WebViewString work? How to launch Google Play from within your app
如果要从Android应用程序链接到您的产品,请创建一个打开URL的Intent。在配置此意图时,将“com.android.vending”传递给Intent.setPackage(),以便用户在Google Play商店应用中查看应用的详细信息而不是选择器。
以下示例指示用户在Google Play中查看包含名称com.example.android的应用:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(
"https://play.google.com/store/apps/details?id=com.example.android"));
intent.setPackage("com.android.vending");
startActivity(intent);
它适用于原生的android开发。你可以这样做:
Action:android.intent.action.VIEW
DataUri:https://play.google.com/store/apps/details?id=com.example.android
ActivityPackage:com.android.vending