joywayer
0636aadbec
4.B 修复:friendsShare 路由跑偏(sharefriend/type 字段兼容 number)
【契约影响】docs/H5-Native-Contract.md §3.1[2]
H5 实际传:{"sharefriend":1, "sharetype":0, "type":2, ...}(number 而非
契约描述的 string "1"/"2")。先前用 obj["sharefriend"]?.asString 只匹配
.string case,遇到 number 全部 fallback 到 "",导致:
- sharefriend = "" → ShareCenter.dispatchSubGame default 分支 →
WechatShare.share(scene: .timeline) → **错走朋友圈**
- type = "" → WechatShare.share else 分支 → **错走链接分享**
实际 H5 意图:sharefriend=1 (好友/弹 SharePanel) + type=2 (截图分享)。
看到的现象:H5 想截图分享给好友,实际成了链接分享到朋友圈。
修复:sharefriend / sharetype / type 改用 asLooseString(number → 整数
字符串,与 commit b058990 修 mediaTypeAudio.user 同款)。对齐原 msext
ObjC 行为:[NSNumber intValue] 与 [NSString intValue] 都得到整数,所以
不论 H5 传 string 还是 number 都能识别。
webpageUrl / title / description 三项 H5 始终传 string,保持 asString
不变。
2026-06-24 09:16:27 +08:00
..
2026-06-24 01:31:52 +08:00
2026-06-24 09:16:27 +08:00
2026-06-23 21:33:46 +08:00
2026-06-22 22:22:23 +08:00
2026-06-22 22:22:23 +08:00
2026-06-24 02:09:28 +08:00
2026-06-23 23:07:23 +08:00
2026-06-24 07:53:14 +08:00
2026-06-24 08:19:21 +08:00
2026-06-24 08:19:21 +08:00