Facebook帖子内Deep Link无法打开Android应用,需补充哪些配置
解决Facebook平台无法正常拉起Deep Link的配置方案
- 补充Intent Filter自动验证属性
现有配置缺少系统级App Link验证标记,Facebook内置浏览器仅会跳转通过系统验证的深度链接,需在intent-filter标签添加android:autoVerify="true"属性,修改后配置如下:<activity android:name="..MyActivity"> <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"/> <data android:host="mywebsite.com"/> <data android:pathPrefix="/screen1"/> <data android:pathPrefix="/screen2"/> </intent-filter> </activity> - 配置服务端验证文件
在你的域名https://mywebsite.com的.well-known目录下创建assetlinks.json文件,参考示例填写你的应用包名、签名SHA256指纹,该文件需支持公开无重定向访问,返回Content-Type为application/json。
示例内容:[ { "relation": ["delegate_permission/common.handle_all_urls"], "target": { "namespace": "android_app", "package_name": "替换为你的应用包名", "sha256_cert_fingerprints": ["替换为你的应用签名SHA256指纹"] } } ] - 完成Facebook开发者后台配置
- 进入对应应用的后台「设置-基础配置」页面,填写正确的Android包名、Activity完整路径、签名Key Hash(注意Facebook要求的是Base64编码格式的签名哈希,测试和正式环境的哈希值都需要添加)
- 进入深度链接配置板块,添加你使用的域名和路径规则,完成域名所有权验证
- 适配Facebook链路规则
若在Facebook帖子、广告场景使用深度链接,需使用后台生成的官方深度链接,不要直接放原生https链接;测试时优先使用正式签名包,避免因签名不一致导致验证失败。
内容的提问来源于stack exchange,提问作者dev90
相关产品推荐
相关产品推荐

