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

Flutter应用Android/iOS深度链接(App Links/Universal Links)失效问题求助

各位大佬好,我现在在开发一个Flutter应用,遇到了深度链接(Android的App Links和iOS的Universal Links)无法正常唤起应用的问题,折腾好几天没找到根源,想请大家帮忙分析下。

问题现象

  • 用户点击类似https://myApp.gov.il/Pages/MainItemPage.aspx的链接时,只会打开设备自带的浏览器,完全不会唤起我们的Flutter应用,Android和iOS平台都是这个情况
  • 我们把相同的.well-known关联文件部署到Firebase托管,修改应用配置指向Firebase域名后,深度链接立刻正常工作,点击链接直接唤起应用
  • 用Google的Digital Asset Links API做验证时,Firebase域名返回验证成功,但生产域名myApp.gov.il报获取错误——虽然这两个关联文件在生产域名上明明可以通过浏览器、Postman正常访问,返回200 OK状态码

已完成的配置(严格遵循官方指南)

Android端(AndroidManifest.xml)

我们给主域名和www子域名都配置了带autoVerify="true"的intent-filter,确保App Links自动验证:

<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:scheme="https" android:host="myApp.gov.il" android:pathPrefix="/Pages/" />
</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:scheme="https" android:host="www.myApp.gov.il" android:pathPrefix="/Pages/" />
</intent-filter>

iOS端(Runner.entitlements)

添加了对应域名的Universal Links关联:

applinks:myApp.gov.il
applinks:www.myApp.gov.il

服务器端(.NET Core 8)

我们在网站根目录的wwwroot下创建了.well-known文件夹,里面包含:

  • assetlinks.json(Android App Links验证用)
  • apple-app-site-association(iOS Universal Links验证用)
    这两个文件都是公开可访问的,没有权限限制,测试请求都返回200 OK。

我们的怀疑点

目前我们猜测可能是生产域名的托管配置有隐藏问题,比如:

  • 服务器的防火墙、WAF策略拦截了Android/iOS官方的验证请求(毕竟是gov域名,可能有特殊安全配置)
  • 关联文件的MIME类型设置不正确?不过Firebase上我们没特意设置也正常
  • 域名的SSL证书有什么问题?但浏览器访问是正常的
  • 或者是.gov.il这类特殊顶级域名的验证逻辑有特殊要求?

我们的预期是:用户点击https://myApp.gov.il/Pages/MainItemPage.aspx这类链接时,能直接唤起Flutter应用,而不是跳转到浏览器。有没有大佬遇到过类似的情况,或者能想到我们漏掉了什么配置细节?麻烦指点一下,谢谢大家!

内容来源于stack exchange

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.07 10:58:03