主机是 Android 中深度链接的必需配置吗?

Ryu*_*yuk 4 android deep-linking intentfilter android-intent

我的问题是标题的确切内容:

主机是 Android 中深度链接的必需配置吗?

我已将 Google Play 与这样的 uri 深度链接:

“market://details?id=com.facebook.katana”他们的 AndroidManifest 有:

                    <data
                    android:scheme="market"
                    android:host="details"
                    android:path=""/>
Run Code Online (Sandbox Code Playgroud)

但是现在我需要深层链接到其他没有任何主机配置的应用程序:

这甚至可能吗?

我去了文档(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>
Run Code Online (Sandbox Code Playgroud)

但它也说:

“至少,标签必须包含 android:scheme 属性。”

所以我想知道深度链接是否需要主机配置?

Ryu*_*yuk 5

简短回答:否

任何应用程序仍然可以在不指定主机的情况下提供深度链接支持,尽管指定它更清楚。