我有一个带查询参数的深层链接。当我点击深层链接时,它不会在对话框中显示我的应用程序,而是显示所有浏览器应用程序。我们是否需要在 assetslinks.json 中添加任何东西来支持查询参数? 请告诉我可能是什么问题。
我的深层链接 URL:myCustomScheme://myHost?type=xxx
最佳答案
对于深层链接,使用 Launcher Activity 中描述的 Intent 过滤器来获取链接中描述的参数。一个 intent-filter 中可以有多个数据标签。下面给出了一个这样的例子:
<activity
android:name=".views.activity.SplashActivity"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:launchMode="singleTask"
android:theme="@style/ColdStart">
<intent-filter>
<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="your host here"
android:scheme="https" />
</intent-filter>
</activity>
关于android - 带有查询参数的深层链接在 Android 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55968499/