Android应用程序的深层链接

时间:2016-04-28 10:05:49

标签: android google-play

我在Store中有一个应用程序,我需要为它添加一个深层链接。

我的问题是没有打开应用程序的链接,它只是给了我在商店中的应用程序页面,如果没有安装商店页面给我选项安装,如果应用已安装,商店为我提供打开卸载

我需要的是:如果在没有经过商店的情况下安装,则自动打开应用程序。

2 个答案:

答案 0 :(得分:0)

试试这个:希望它可以帮助

Intent launchIntent=getPackageManager().getLaunchIntentForPackage("yourPackagename");
if (launchIntent == null) {
    startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(" Playstore your APP link")));
  } else {
           startActivity(launchIntent);
         }

答案 1 :(得分:0)

我发现了,我必须在我的falvors中将此代码添加到我的Android清单中。

 <!-- Accepts URIs that begin with "http://” -->
               <data android:scheme="http"
                  android:pathPrefix="/casa" />

终端中的commadn是:

$ adb shell am start  -W -a android.intent.action.VIEW -d "http://example/casa" com.paperpad.casadelmar