You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android无host自定义Deep Link唤起App的intent-filter配置方法

Deep Link无host场景配置方案

核心配置逻辑

你需要匹配的testapp://payload=12345属于无标准域名host的Deep Link,根据匹配范围需求可选择以下两种配置:

方案1:全量匹配所有同scheme链接(兼容性最好)

直接省略android:host属性,仅指定scheme即可,所有testapp://开头的链接都会触发该intent-filter:

<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="testapp" />
</intent-filter>

配置生效后,在接收跳转的Activity中通过getIntent().getData()即可获取完整Deep Link内容,自行解析提取payload参数即可。

方案2:限制仅匹配payload开头的链接

如果应用需要同时适配同scheme下带标准host的其他Deep Link,可通过host通配符缩小匹配范围:

<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="testapp"
        android:host="payload*"
     />
</intent-filter>

该配置会过滤掉testapp://www.xxx.com这类带标准域名的链接,仅匹配host段以payload开头的Deep Link。

异常排查

如果在微信、QQ等第三方应用中点击链接无法唤起,优先到系统浏览器输入该链接测试:

  • 浏览器可正常唤起:属于第三方应用的链接识别拦截规则,可申请平台白名单,或者调整Deep Link格式为testapp:///payload=12345(三个斜杠代表host为空),对应配置调整为:
<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="testapp"
        android:host=""
        android:pathPattern="/payload=.*"
     />
</intent-filter>
  • 浏览器无法唤起:检查manifest配置是否有拼写错误,intent-filter是否绑定到了正确的Activity。

内容的提问来源于stack exchange,提问作者Adrian Ivasku

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.17 00:15:10