Files
youle_app_ios_v2/ylgamehall/Source/Bridge/Handlers/OpenurlTitleDataHandler.swift
T
joywayerandClaude Opus 4.7 68cf7140d7 Phase 6/7 stub:SwitchOverGameData + OpenurlTitleData
补齐 H5 桥 §3.1 [15][17]两个 stub handler,让 H5 调子游戏切换 / 弹层
入口时不再报 "no handler registered",避免业务流程卡住。完整流程留
Phase 6 / Phase 7 实施。

新增:
  - Source/Bridge/Handlers/SwitchOverGameHandler.swift §3.1 [17]stub
    cb "SwitchOverGameData"(驼峰首字母大写沿用 msext 字面)
    完整实现需 AppCoordinator + SubGameViewController + SubGameDownloader
    (Phase 6.4 落地)
  - Source/Bridge/Handlers/OpenurlTitleDataHandler.swift §3.1 [15]stub
    cb "OpenurlTitleData"
    完整实现需 OverlayViewController + window.settings polyfill + 3s 节流
    (Phase 7 落地);注意契约硬约束 "title " 末尾空格已在注释提示

WebContainer.registerBridgeHandlers 接入。

至此 H5 桥 §3.1 大厅可调的全部 16 项 handler(除 backgameData / createRoom
等子游戏专属 §H 4 项)都已注册(含完整实现 / stub 两种状态),
H5 启动 / 业务期任何 handler 调用都不会报 "no handler"。

BuildProject 通过

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-22 20:14:31 +08:00

29 lines
1.0 KiB
Swift
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.
//
// OpenurlTitleDataHandler.swift
// ylgamehall
//
// H5 → Native handler stubOpenurlTitleData — 打开内嵌 WebView 弹层(threeView
// 契约:docs/H5-Native-Contract.md §3.1 15
//
// Phase 7 完整实现需要 OverlayViewController + window.settings polyfill
// + 3 秒节流。当前为 stub(仅 cb 维持契约),让 H5 调时不报 "no handler"。
//
// ⚠️ 注意入参 key "title " 末尾有空格(msext 历史契约硬约束),完整实现时
// 必须 obj["title "]?.asString 而不是 obj["title"]?.asString。
//
import Foundation
public enum OpenurlTitleDataHandler {
public static func register(on bridge: any BridgeProtocol) {
// 【15】OpenurlTitleData
// 入参 url / "title "(末尾空格!) / data / orientation
// cb: "OpenurlTitleData"
// 完整实现需 push OverlayViewController + 3 秒节流(first_Time 标志)
bridge.register("OpenurlTitleData") { _, callback in
callback?(.string("OpenurlTitleData"))
}
}
}