// // ShareCenter.swift // ylgamehall // // H5 friendsShare 调用入口的协调中心,按 msext gameController.m:575-597 行为: // - sharefriend == "1"(好友/私聊)→ 弹 SharePanel 三选一(微信/QQ/抖音) // - sharefriend == "2"(朋友圈) → 直接 WechatShare(朋友圈 timeline 场景) // // fire-and-forget:H5 端 sharesuccess 已在 FriendsShareHandler 立即触发, // 这里只负责拉起 UI / SDK,不需要回传结果。 // import Foundation @MainActor public enum ShareCenter { public static func dispatch(_ content: ShareContent) { switch content.sharefriend { case "1": // 好友/私聊 → SharePanel 三选一 SharePanel.show(content: content) case "2": // 朋友圈 → 直接 WechatShare(timeline 场景) WechatShare.shared.share(content, scene: .timeline) default: // 未知 sharefriend:msext 沿用第二条分支兜底(朋友圈微信) WechatShare.shared.share(content, scene: .timeline) } } }