android - 带有查询参数的深层链接在 Android 中不起作用

标签 android deeplink

我有一个带查询参数的深层链接。当我点击深层链接时,它不会在对话框中显示我的应用程序,而是显示所有浏览器应用程序。我们是否需要在 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/

相关文章:

android - 项目刷新失败 - 错误 :Cause: org/gradle/internal/TrueTimeProvider

android - 方法 getWindow().setBackgroundDrawableResource(int resid) 在 onCreate() 之外不起作用

ios - 在 iOS 上使用第 3 方应用程序打开 Uber 应用程序然后返回到第 3 方应用程序的可能性

Android 深层链接无法在 Skype 中打开

ios - 对 info.plist 中定义的深层链接没有反应

java - 如何在 Android 中合并两个 JSON 数组?

Android:如何找到从上下文菜单中单击的位置

android - 如何在应用程序中创建深层链接?

ios - iOS 上的优步深层链接取件位置问题

android - 结合父级的 wrap_content 和子级的 fill_parent