// // FriendsShareHandler.swift // ylgamehall // // H5 → Native handler stub:friendsSharetypeUrlToptitleDescript — 分享 // 契约:docs/H5-Native-Contract.md §3.1 [2] + §3.2 [11]sharesuccess // // Phase 4.A 阶段为 stub(仅 cb 维持契约);Phase 4.B 微信 SDK 接入 + Phase 4.C // QQ URL Scheme 完整实现后升级。 // // 完整实现: // 1. 入参解析:sharefriend (1=好友 / 2=朋友圈) + sharetype (1=微信 / 2=微信 / // 3=闲聊;契约 §3.1 [2]) + type (1=链接 / 2=截图 / 3=远端图) + url + // title + description // 2. ShareCenter.dispatch(req): // - sharetype = 3 → 闲聊 NoopSharePlatform(暂未集成) // - 否则 → WeChatShare(Phase 4.B SDK 接入) // 3. 分享完成 → bridge.call("sharesuccess", { success: "2", type: }) // // ⚠️ QQ 分享按用户约定**不依赖 SDK**,走 URL Scheme(mqq://share/to_fri、 // mqqapi://share/to_qzone 等);参 daoqi/msext QQShareManager.m fallback // 部分(Phase 4.C 真实落地) // import Foundation public enum FriendsShareHandler { public static func register(on bridge: any BridgeProtocol) { // 【2】friendsSharetypeUrlToptitleDescript // 入参:sharefriend / sharetype / type / url / title / description // cb: "sharefriend"(msext 字面,沿用) // 完整实现需触发 sharesuccess 反向 callback(Phase 4.B/4.C) bridge.register("friendsSharetypeUrlToptitleDescript") { _, callback in callback?(.string("sharefriend")) } } }