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

Expo中Android端DeepLink无法唤醒App问题求助(iOS正常)

Android DeepLink无法唤醒应用的问题修复

针对你Android端DeepLink无法唤醒应用的问题,主要是配置里的三处错误导致的,以下是修正方案:

1. 修正app.config.json中的intentFilters配置

你的配置存在两个明显问题:

  • 字段名错误:category应该是复数形式categories
  • http scheme的host格式错误:不能包含scheme和多余符号,需拆分IP与端口或直接配置合法主机地址

修正后的intentFilters:

intentFilters: [
  {
    action: "VIEW",
    autoVerify: true,
    data: [
      {
        scheme: "http",
        host: "192.168.1.4",
        port: "3000",
        pathPrefix: "/"
      },
      {
        scheme: "rentcreek",
        host: "*",
        pathPrefix: "/"
      }
    ],
    categories: ["BROWSABLE", "DEFAULT"] // 修正为复数categories
  }
]

2. 完善Linking的prefixes配置

当前prefixes仅包含Linking.createURL('/')生成的前缀,未覆盖自定义scheme和http链接前缀,导致Android无法识别对应链接。需补充完整前缀:

修正后的Linking配置:

const prefixes = [
  Linking.createURL('/'),
  'rentcreek://', // 加入自定义scheme前缀
  'http://192.168.1.4:3000/' // 加入http链接前缀
];

const config = {
  screens: {
    Splash: "Splash"
  }
};

const linking = {
  prefixes,
  config
};

3. 验证步骤

  • 重新构建并安装Android应用,确保配置生效
  • 用adb命令测试自定义scheme:adb shell am start -a android.intent.action.VIEW -d "rentcreek://test"
  • 用adb命令测试http链接:adb shell am start -a android.intent.action.VIEW -d "http://192.168.1.4:3000/test"

内容的提问来源于stack exchange,提问作者Sumit Sharma

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.09 01:25:18