当声明多个域时,Android应用链接消除歧义对话框

问题描述 投票:1回答:1

[嗨,我正在尝试按照以下说明添加应用程序链接:https://developer.android.com/training/app-links

所有功能都可以在单个域中正常运行,但是当我尝试包含多个域时,Android系统始终显示消歧对话框。

清单文件中是否包含多个域(而不是SUBdomain)的变通办法,以避免显示歧义对话框?

这里是我的AndroidManifest.xml

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleInstance" android:name="MainActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="adjustResize">
  <intent-filter android:label="@string/launcher_name">
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
  </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="exampl1.it" android:scheme="http" android:path="/applink"/>
  </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="example1.it" android:scheme="https" android:path="/applink"/>
  </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="p.example2.it" android:scheme="http"/>
  </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="p.example2.it" 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="example3.com" android:scheme="http" android:path="/path/to-deep"/>
  </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="example3.com" android:scheme="https" android:path="/path/to-deep"/>
  </intent-filter>
</activity>
android android-studio manifest deep-linking android-app-links
1个回答
1
投票

请参阅我在https://stackoverflow.com/a/60342565/2914140的答案。我将所有<data>标签都划分为属性:

<data android:scheme="https" />
<data android:host="example.com" />
© www.soinside.com 2019 - 2024. All rights reserved.