 joywayerandClaude Opus 4.7
|
2ad4563d16
|
Phase 4.B:SharePlatform 框架 + SharePanel 三选一 UI + ShareCenter 分发
按 msext gameController.m:575-597 / SharePanel.m 模式落地分享框架。
新增 Source/Share/:
- SharePlatform.swift:
* SharePlatform 协议(name / isInstalled / share async → ShareResult)
* ShareContent struct(nonisolated Sendable,6 字段 sharefriend/sharetype/
type/webpageUrl/title/desc)
* ShareResult enum (success / cancelled / notInstalled / failed)
* ShareScene enum (friend / timeline)
- SharePanel.swift:
* @MainActor UIView,半透明黑底覆盖全屏 + 底部圆角内容视图滑入
* 三按钮(微信绿 / QQ 蓝 / 抖音黑)+ label 等间距居中布局
* 已安装平台按钮高亮,未装置灰
* 点击空白区 dismiss + completion(.cancelled)
* 点击按钮 dismiss + 触发对应 SharePlatform.share + completion(result)
* 0.25s 滑入/滑出动画
* 与 msext SharePanel.m 等价行为
- ShareCenter.swift:
* sharefriend == "1" → SharePanel.show 三选一
* sharefriend == "2" → WechatShare.share scene: .timeline 朋友圈
* 与 msext gameController.m:585 行为 1:1
- WechatShare.swift:stub(Phase 4.E 等微信 SDK 接入)
- QQShare.swift:stub + canOpenURL("mqqapi://") 检测(Phase 4.C 升级
URL Scheme 真实调起)
- DouyinShare.swift:stub + canOpenURL("snssdk1128://") 检测(Phase 4.D 升级
URL Scheme + Photos)
FriendsShareHandler 升级:
- 入参解析为 ShareContent
- 调 ShareCenter.dispatch
- completion 内根据 result 触发 sharesuccess 反向 callback:
* success / cancelled → bridge.call("sharesuccess", {success:"2", type:sharefriend})
* notInstalled / failed → 不发(H5 业务期 timeout 后自行 fallback,msext 乐观策略)
ShareContent 标 nonisolated 解 Swift 6 actor 隔离(项目默认 MainActor isolation
让 struct 跨 actor 受限)。
BuildProject 通过
Plan §5 Phase 4.2 勾选
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-22 20:02:34 +08:00 |
|
 joywayerandClaude Opus 4.7
|
aa80aec18c
|
Phase 4.A:登录+分享 stub + QQ 改走 URL Scheme 不依 SDK
按用户约定调整 Phase 4 方向:微信继续走 SDK(等项目方提供),QQ 分享
改用 URL Scheme 直接调起 QQ app,**不依赖 SDK**。
调研 daoqi/msext/Class/Utils/QQShareManager.m 发现已有完整的 URL Scheme
fallback 路径:
- line 14: __has_include(<TencentOpenAPI/QQApiInterface.h>) 条件编译
- line 231 注释: "Fallback: 使用 URL Scheme (mqqapi://) - 无需 SDK,
直接调起 (Legacy)"
- mqqapi://share/to_fri / mqqapi://share/to_qzone / mqqopensdkfriend://share
等 schema 实现见 line 733/786/789
新增 handler stub(让 H5 启动 / 业务期调登录 / 分享不报 "no handler"):
- Source/Bridge/Handlers/AccreditLoginHandler.swift
accreditlogin cb "Response from accreditlogin"
完整实现需 Phase 4.B 微信 SDK + WeChatManager.authorize() + WeChatAuth.exchangeForUser
+ bridge.call("sharelogin", 7 字段含大写 Province) 反向 callback
- Source/Bridge/Handlers/FriendsShareHandler.swift
friendsSharetypeUrlToptitleDescript cb "sharefriend"
完整实现需 ShareCenter 策略分发 + sharesuccess 反向 callback
WebContainer.registerBridgeHandlers 接入。
文档调整:
- Plan §2.3 阻塞表:QQ OpenSDK 标"不需要",改 URL Scheme 路径
- Plan §5 Phase 4 前置:去掉 QQ OpenSDK 一行
- Plan §5 Phase 4.2:完整改写为 URL Scheme 方案,含 LSApplicationQueriesSchemes
清单 + URL 构造样例 + "调起即 success" 乐观策略说明
- Plan §8 进度追踪:4.2 QQ SDK Vendor 标"不需要"
- Plan §6.4 里程碑加 3 行(前两轮 commit hash 补 + 本次)
- CLAUDE.md 依赖管理段加 "不接入 QQ SDK" 约定(与"不引入 CocoaPods"
并列的负面清单)
- Verification-Checklist Phase 4 章节:E.19/E.20 stub + K/L 待 4.B/4.C
完整后填充验证项
BuildProject 通过
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
2026-06-22 19:19:23 +08:00 |
|