React Native安卓/iOS端Chrome无法打开深度链接问题求助
React Native 深度链接在Chrome中无法生效的解决方案
iOS 端 Chrome 问题处理
- 优先使用 Universal Links:Chrome iOS 对自定义 URL Scheme(如
yourapp://)支持有限,需通过 Universal Links 实现跳转。确保:- 域名已配置 HTTPS,且
.well-known或根目录下存在apple-app-site-association文件,格式示例:{ "applinks": { "apps": [], "details": [ { "appID": "你的TeamID.应用BundleID", "paths": ["*"] } ] } } - Xcode 项目的
Signing & Capabilities中添加Associated Domains,填入applinks:你的域名。
- 域名已配置 HTTPS,且
- 使用HTTPS格式链接测试:在Chrome中直接打开
https://你的域名/深度链接路径,而非自定义Scheme链接。若需从网页触发,可通过页面内链接跳转,避免直接在地址栏输入自定义Scheme。
Android 端 Chrome 问题处理
- 完善Manifest中的Intent过滤:确保深度链接的
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="你的域名" android:pathPrefix="/深度链接路径" /> </intent-filter>android:autoVerify="true"是Chrome验证链接的关键配置。 - 配置数字资产链接:
- 创建
assetlinks.json文件,替换为你的应用包名和SHA-256签名:[ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "你的应用包名", "sha256_cert_fingerprints": ["应用签名的SHA256值"] } } ] - 将文件上传到
https://你的域名/.well-known/assetlinks.json,确保可直接访问。
- 创建
- 清除缓存重试:若配置完成后仍无效,清除Chrome的应用缓存后再次测试HTTPS格式的深度链接。
内容的提问来源于stack exchange,提问作者phuocantd
相关产品推荐
相关产品推荐

