Android 是否有可能处理与多个主机的应用程序链接?
我的清单文件中需要多台主机进行应用程序链接,但这不起作用。如果我在同一意向筛选器中添加另一个主机的其他数据标记。。以前有效的数据标记不再有效。多个意图过滤器也是如此。如果我尝试为另一个主机添加另一个意图过滤器,则第一个主机(和第二个主机)无法工作 在这里你可以看到我所做的: AndroidManifest.xmlAndroid 是否有可能处理与多个主机的应用程序链接?,android,kotlin,android-manifest,applinks,android-deep-link,Android,Kotlin,Android Manifest,Applinks,Android Deep Link,我的清单文件中需要多台主机进行应用程序链接,但这不起作用。如果我在同一意向筛选器中添加另一个主机的其他数据标记。。以前有效的数据标记不再有效。多个意图过滤器也是如此。如果我尝试为另一个主机添加另一个意图过滤器,则第一个主机(和第二个主机)无法工作 在这里你可以看到我所做的: AndroidManifest.xml <intent-filter android:autoVerify="true"> <action android:name="android
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.host1.com"
android:pathPattern="/path/.*"
android:scheme="https" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.host2.com"
android:pathPattern="/path/.*"
android:scheme="https" />
</intent-filter>
如果我用host2删除意图过滤器,host1将工作
有什么想法吗?尝试将此意图过滤器添加到与另一个不同的活动中,或者尝试为每个主机名创建多个虚拟入口点 我知道这并不理想,但它会成功的 有关如何实现此目标的更多信息,请参见此处: 例如:
<activity android:name=”MainActivity”>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.example.com" />
<data android:scheme="https" />
</intent-filter>
</activity>
<activity android:name=”ShadowActivity1”>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="www.example.net" />
</intent-filter>
</activity>
<activity android:name=”ShadowActivity2”>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="www.example123332.net"/>
</intent-filter>
</activity>
当您的任意一个意向过滤器上出现android:autoVerify=“true”
时的引用,在android 6.0及更高版本的设备上安装您的应用程序会导致系统尝试验证与任何应用程序意向过滤器中的URL关联的所有主机
很可能您的主机2下没有AssetLink.json。因此,系统会检查两台主机以进行授权,而host2失败,因此整个验证失败,包括host1
p.S.使用不同的目的过滤器进行不同的活动也不会有帮助。文档。我只想在一个活动中使用此功能,因为我不想将它们作为子域进行扩展:正如我所提到的,如果我这样做:“以前工作的数据标记不再工作。”