android 个应用程序的深度 link
Deep link of android application
我在商店中有一个应用程序,我需要为它添加一个深度link。
我的问题是 link 没有打开应用程序,它只是给我应用程序在商店中的页面,如果没有安装,商店页面让我可以选择 安装,如果应用程序已安装,商店会给我 open 或 uninstall.
我需要的是:安装后自动打开,无需经过商店。
尝试this:hope可能会有帮助
Intent launchIntent=getPackageManager().getLaunchIntentForPackage("yourPackagename");
if (launchIntent == null) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(" Playstore your APP link")));
} else {
startActivity(launchIntent);
}
我找到了,我也不得不将此代码添加到我的 Android 清单中。
<!-- Accepts URIs that begin with "http://” -->
<data android:scheme="http"
android:pathPrefix="/casa" />
终端中的命令是:
$ adb shell am start -W -a android.intent.action.VIEW -d "http://example/casa" com.paperpad.casadelmar
我在商店中有一个应用程序,我需要为它添加一个深度link。
我的问题是 link 没有打开应用程序,它只是给我应用程序在商店中的页面,如果没有安装,商店页面让我可以选择 安装,如果应用程序已安装,商店会给我 open 或 uninstall.
我需要的是:安装后自动打开,无需经过商店。
尝试this:hope可能会有帮助
Intent launchIntent=getPackageManager().getLaunchIntentForPackage("yourPackagename");
if (launchIntent == null) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(" Playstore your APP link")));
} else {
startActivity(launchIntent);
}
我找到了,我也不得不将此代码添加到我的 Android 清单中。
<!-- Accepts URIs that begin with "http://” -->
<data android:scheme="http"
android:pathPrefix="/casa" />
终端中的命令是:
$ adb shell am start -W -a android.intent.action.VIEW -d "http://example/casa" com.paperpad.casadelmar