topfans/docs/superpowers/specs/2026-06-11-share-modal-redesign-aasa-note.md

48 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# apple-app-site-association 部署说明
> 配合 docs/superpowers/specs/2026-06-11-share-modal-redesign-design.md § 4.2 使用
> 创建日期2026-06-25
## 必填原因
iOS 13+ 微信 / 微博 SDK 强制要求 Universal Links 验证。若 `https://h5.topfans.com/uni-universallinks/apple-app-site-association` 文件不存在或内容错误,`uni.share` 唤起微信会被 SDK 静默拒绝errMsg 报 "bad params")。
## 部署位置
URL`https://h5.topfans.com/uni-universallinks/apple-app-site-association`
- 无后缀(不是 .json
- HTTPS强制
- Content-Type: `application/json`
- 文件需可直接 GET无鉴权
## 文件内容模板
```json
{
"applinks": {
"apps": [],
"details": [
{
"appIDs": ["<TeamID>.com.topfans.app"],
"components": [
{ "/": "/uni-universallinks/*", "comment": "match" }
]
}
]
}
}
```
`<TeamID>` 替换为苹果开发者账号的 Team ID10 位字母数字)。
## 部署后验证
1. 访问 `https://h5.topfans.com/uni-universallinks/apple-app-site-association` 应返回上述 JSON
2. iOS 设备 Safari 访问 `https://h5.topfans.com/uni-universallinks/` 应弹"在 TopFans 中打开"提示
3. 后端/运维确认后,前端方可启用真实微信/微博分享测试
## 阻塞状态
当前 `<REPLACE_WITH_WEIXIN_APPID>` 等占位符未替换,真机分享测试暂不可用。
前端 dev 环境用 `share-mock.js` 绕过。