// // StartLocationHandler.swift // ylgamehall // // H5 → Native handler:startlocation — 定位(Phase 5 完整实现,本期为 stub) // 契约:docs/H5-Native-Contract.md §3.1 [20] + §3.2 [6] // // Stub 行为: // - 接收 startlocation 调用,cb "startlocation"(响应不为 undefined,H5 不卡) // - **不触发** getlocationinfo 反向 callback(暂无高德 SDK,做不到真实定位) // - H5 业务侧若强依赖 getlocationinfo,需等 Phase 5 完整接入 AMapLocationKit // // 按 CLAUDE.md 原则 A 第一准则:H5 调啥就得有人接,即使没真实业务也要注册。 // import Foundation public enum StartLocationHandler { public static func register(on bridge: any BridgeProtocol) { bridge.register("startlocation") { _, callback in // Phase 2 stub:仅响应 callback,不真实定位 // Phase 5 接入 LocationKit + 高德 AMapLocationKit.xcframework 时升级为完整实现 callback?(.string("startlocation")) } } }