Skip to content

Commit 9c9261b

Browse files
rulongzhangMinTate
authored andcommitted
【iOS】Observe the data from the successfully run demo
1 parent 5409c55 commit 9c9261b

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

application/App-UIKit/Login/LoginViewController.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class LoginViewController: UIViewController {
5555
switch result {
5656
case .success():
5757
UserDefaults.standard.set(userId, forKey: self.userIdKey)
58+
observerRunDemo()
5859
LoginStore.shared.state.subscribe(StatePublisherSelector(keyPath: \LoginState.loginUserInfo))
5960
.receive(on: RunLoop.main)
6061
.dropFirst()
@@ -79,6 +80,23 @@ class LoginViewController: UIViewController {
7980
}
8081
}
8182

83+
private func observerRunDemo() {
84+
let dictParam: [String: Any] = [
85+
"UIComponentType": 1302
86+
]
87+
guard let dataParam = try? JSONSerialization.data(withJSONObject: dictParam, options: []),
88+
let strParam = String(data: dataParam, encoding: .utf8)
89+
else {
90+
return
91+
}
92+
V2TIMManager.sharedInstance().callExperimentalAPI(
93+
api: "reportTUIFeatureUsage",
94+
param: strParam as NSObject,
95+
succ: { _ in },
96+
fail: { _, _ in }
97+
)
98+
}
99+
82100
private func loginTUICore(userID: String) {
83101
// FIXME: 临时方案 修复RoomKit 1.0版本 在应用内会议相关功能不可用问题, 后续升级到RoomKit 2.0版本 这部分逻辑将删除。
84102
TUILogin.login(Int32(SDKAPPID), userID: userID, userSig: GenerateTestUserSig.genTestUserSig(identifier: userID)) { [weak self] in

application/App-UIKit/Main/UI/MainViewController.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,41 @@ extension MainViewController {
134134
extension MainViewController {
135135

136136
func gotoCallView() {
137+
observerTUI(type: 1303)
137138
let enterCallVC = CallViewController()
138139
enterCallVC.title = "call".localized
139140
enterCallVC.hidesBottomBarWhenPushed = true
140141
navigationController?.pushViewController(enterCallVC, animated: true)
141142
}
142143

143144
func gotoLiveView() {
145+
observerTUI(type: 1119)
144146
let enterLiveVC = LiveViewController()
145147
navigationController?.pushViewController(enterLiveVC, animated: true)
146148
}
147149

148150
func gotoRoomView() {
151+
observerTUI(type: 1205)
149152
let roomHomeViewController = RoomHomeViewController()
150153
self.navigationController?.pushViewController(roomHomeViewController, animated: true)
151154
}
155+
156+
private func observerTUI(type: Int64) {
157+
let dictParam: [String: Any] = [
158+
"UIComponentType": type
159+
]
160+
guard let dataParam = try? JSONSerialization.data(withJSONObject: dictParam, options: []),
161+
let strParam = String(data: dataParam, encoding: .utf8)
162+
else {
163+
return
164+
}
165+
V2TIMManager.sharedInstance().callExperimentalAPI(
166+
api: "reportTUIFeatureUsage",
167+
param: strParam as NSObject,
168+
succ: { _ in },
169+
fail: { _, _ in }
170+
)
171+
}
152172
}
153173

154174
extension MainViewController {

0 commit comments

Comments
 (0)