Phase 8.4:PhoneStateMonitor → phonestate 反向 callback
契约 §3.1 [14]phonestate 落地。msext 用已废弃的 CTCallCenter(iOS 10+
deprecated);新外壳改用 CallKit CXCallObserver,对 H5 输出字符串一致:
- "2" = 来电响铃中(hasConnected=false / isOutgoing=false / hasEnded=false)
或已连接(hasConnected=true)
- "0" = 挂断(hasEnded=true)
- 其它(拨出未连接、保持)不发
新增:
- Source/Resource/PhoneStateMonitor.swift(@MainActor singleton,与 BatteryMonitor /
NetworkMonitor 同款 pattern;onChange closure + start/stop 生命周期)
接入:
- SubGameViewController.setupExternalSubscriptions:start + onChange
- SubGameViewController.teardownExternalSubscriptions:onChange=nil + stop
- 大厅 WebContainerViewController 不订阅(msext gameController 同款边界,
契约表注「已注释」表示大厅不发;H5 子游戏才依赖此事件做哑麦/暂停)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
8fc37b0827
commit
ded6b5d86b
@@ -680,9 +680,11 @@ H5 调 `OpenurlTitleData` 打开弹层 WebView,弹层内 H5 用 `window.settin
|
||||
- `createRoom` stub → `cb("createRoom")`
|
||||
- `getVideoinfo` stub → `cb("getVideoinfo")`
|
||||
- `exitRoom` stub → `cb("exitRoom")`
|
||||
- [ ] **8.4** `Source/Telephony/CallCenterMonitor.swift`:CXCallObserver 监听通话状态
|
||||
- 来电 → `bridge.call("phonestate", "2")`
|
||||
- 挂断 → `bridge.call("phonestate", "0")`
|
||||
- [x] **8.4** `Source/Resource/PhoneStateMonitor.swift`:CXCallObserver 监听通话状态(CallKit;不用废弃的 CTCallCenter)
|
||||
- 来电响铃中(hasConnected=false, isOutgoing=false, hasEnded=false)或 已连接(hasConnected=true)→ "2"
|
||||
- 挂断(hasEnded=true)→ "0"
|
||||
- 仅 SubGameViewController.setupExternalSubscriptions 挂载 + teardown 时 stop(大厅不订阅)
|
||||
- 反向 callback `bridge.call("phonestate", data:.string(state))`
|
||||
- [ ] **8.5** `RecordUploader.onUploaded` 已在 Phase 3,需要在 SubGameHandlers 里**额外**触发 `recordSuccess({fileUrl, fileName, fileKey})`(契约 §3.2 表 [15])
|
||||
- [ ] **8.6** `AgoraVideoRoom.swift` 留蓝图骨架(`#if AGORA_ENABLED` 包裹,默认 OFF)
|
||||
|
||||
@@ -966,7 +968,7 @@ H5 调 `OpenurlTitleData` 打开弹层 WebView,弹层内 H5 用 `window.settin
|
||||
- [ ] 8.1 VideoRoom 协议
|
||||
- [ ] 8.2 NoopVideoRoom
|
||||
- [ ] 8.3 3 个 stub handler
|
||||
- [ ] 8.4 CallCenterMonitor → phonestate
|
||||
- [x] 8.4 PhoneStateMonitor → phonestate(CXCallObserver;仅子游戏订阅)
|
||||
- [ ] 8.5 recordSuccess 双 callback
|
||||
- [ ] 8.6 AgoraVideoRoom 蓝图(#if AGORA_ENABLED OFF)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user