【发布时间】:2014-09-23 15:06:04
【问题描述】:
我的问题是标题的确切含义:
主机是 Android 中深度链接的必需配置吗?
我已经与 Google Play 深度链接到这样的 uri:
“market://details?id=com.facebook.katana”他们的 AndroidManifest 有:
<data
android:scheme="market"
android:host="details"
android:path=""/>
但现在我需要深度链接到没有任何主机配置的其他应用程序:
这可能吗?
我去了文档(https://developer.android.com/training/app-indexing/deep-linking.html#handling-intents),我看到他们也在使用主机配置:
<activity
android:name="com.example.android.GizmosActivity"
android:label="@string/title_gizmos" >
<intent-filter android:label="@string/filter_title_viewgizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="example"
android:host="gizmos" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="gizmos" />
</intent-filter>
</activity>
但它也说:
“标签至少必须包含 android:scheme 属性。”
所以我想知道主机配置对于深度链接是强制性的吗?
【问题讨论】:
标签: android android-intent intentfilter deep-linking