@tencentcloud/sdk-mcp 1.7.3 → 1.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +22 -23
  3. package/knowledge/path-meta.js +23 -1
  4. package/package.json +1 -1
  5. package/resource/index/manifest.json +1 -1
  6. package/resource/integration/callkit/preset/android/integration.md +4 -0
  7. package/resource/integration/callkit/preset/flutter/integration.md +8 -4
  8. package/resource/integration/callkit/preset/ios/integration.md +16 -15
  9. package/resource/integration/callkit/preset/react/integration.md +2 -2
  10. package/resource/integration/callkit/preset/vue/integration.md +9 -12
  11. package/resource/integration/chat/preset/android/integration.md +5 -147
  12. package/resource/integration/chat/preset/flutter/integration.md +22 -130
  13. package/resource/integration/chat/preset/ios/integration.md +12 -279
  14. package/resource/integration/chat/preset/react/integration.md +27 -1
  15. package/resource/integration/chat/preset/uni-app/integration.md +5 -1
  16. package/resource/integration/chat/preset/vue/integration.md +21 -31
  17. package/resource/integration/livekit/preset/live/android/live-host-integration.md +4 -0
  18. package/resource/integration/livekit/preset/live/ios/live-host-integration.md +4 -0
  19. package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -3
  20. package/resource/integration/livekit/preset/live/vue/live-list-integration.md +3 -4
  21. package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -1
  22. package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -1
  23. package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +4 -9
  24. package/resource/integration/roomkit/preset/vue/integration.md +152 -652
  25. package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +490 -0
  26. package/resource/knowledge/callkit/best-practice/flutter/android-keep-call-alive-background.md +79 -0
  27. package/resource/knowledge/callkit/best-practice/flutter/background-incoming-call-no-notification.md +99 -0
  28. package/resource/knowledge/callkit/best-practice/flutter/ios-keep-call-alive-background.md +93 -0
  29. package/resource/knowledge/callkit/best-practice/flutter/ios-startup-crash-version-voip.md +68 -0
  30. package/resource/knowledge/callkit/core-sdk/android/answer-call.md +2 -2
  31. package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -5
  32. package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +7 -7
  33. package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +10 -10
  34. package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +1 -1
  35. package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +18 -16
  36. package/resource/knowledge/callkit/core-sdk/ios/make-call.md +16 -14
  37. package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +19 -19
  38. package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +16 -16
  39. package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +2 -86
  40. package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +2 -104
  41. package/resource/knowledge/callkit/core-sdk/web/call-event.md +2 -2
  42. package/resource/knowledge/callkit/faq/android.md +4 -4
  43. package/resource/knowledge/callkit/faq/common.md +4 -4
  44. package/resource/knowledge/callkit/faq/error-code.md +62 -36
  45. package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +1 -1
  46. package/resource/knowledge/callkit/preset/android/api.md +10 -10
  47. package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
  48. package/resource/knowledge/callkit/preset/harmonyos/integration.md +322 -0
  49. package/resource/knowledge/callkit/preset/ios/api.md +9 -9
  50. package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +293 -0
  51. package/resource/knowledge/callkit/preset/miniprogram/api.md +19 -19
  52. package/resource/knowledge/callkit/preset/miniprogram/integration.md +292 -0
  53. package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +521 -0
  54. package/resource/knowledge/callkit/preset/uni-app/api.md +49 -0
  55. package/resource/knowledge/callkit/preset/uni-app/integration.md +353 -0
  56. package/resource/knowledge/chat/preset/android-view/integration.md +54 -102
  57. package/resource/knowledge/chat/preset/ios/features/language.md +5 -5
  58. package/resource/knowledge/chat/preset/ios-uikit/integration.md +194 -926
  59. package/resource/knowledge/chat/preset/react/features/search.md +9 -214
  60. package/resource/knowledge/chat/preset/react/h5/integration.md +965 -0
  61. package/resource/knowledge/chat/preset/vue/features/chat-header.md +0 -36
  62. package/resource/knowledge/chat/preset/vue/features/contact-list.md +0 -34
  63. package/resource/knowledge/chat/preset/vue/features/conversation-list.md +0 -39
  64. package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +0 -74
  65. package/resource/knowledge/chat/preset/vue/features/message-input.md +4 -4
  66. package/resource/knowledge/chat/preset/vue/features/search.md +9 -790
  67. package/resource/knowledge/chat/preset/vue/h5/integration.md +724 -0
  68. package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +3 -3
  69. package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -3
  70. package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +3 -3
  71. package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -3
  72. package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +3 -3
  73. package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -3
  74. package/resource/knowledge/livekit/core-sdk/features/uni-app/audience-list.md +3 -3
  75. package/resource/knowledge/livekit/core-sdk/features/uni-app/live-list.md +3 -170
  76. package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +1 -1
  77. package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +3 -3
  78. package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -1
  79. package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +3 -3
  80. package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +3 -3
  81. package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +1 -1
  82. package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +3 -3
  83. package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +2 -2
  84. package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +13 -78
  85. package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +5 -70
  86. package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +10 -10
  87. package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +1 -1
  88. package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +4 -4
  89. package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -1
  90. package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +1 -1
  91. package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +4 -4
  92. package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +7 -7
  93. package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +1 -24
  94. package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +0 -3
  95. package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +0 -5
  96. package/resource/knowledge/push/api-reference/harmonyos.md +9 -9
  97. package/resource/knowledge/push/api-reference/unity.md +10 -10
  98. package/resource/knowledge/push/api-reference/unreal-engine.md +11 -11
  99. package/resource/knowledge/push/config/donut.md +3 -3
  100. package/resource/knowledge/push/config/harmonyos.md +12 -12
  101. package/resource/knowledge/push/config/ios.md +2 -2
  102. package/resource/knowledge/push/integration/android.md +90 -1067
  103. package/resource/knowledge/push/integration/donut.md +11 -11
  104. package/resource/knowledge/push/integration/flutter.md +38 -24
  105. package/resource/knowledge/push/integration/harmonyos.md +1 -11
  106. package/resource/knowledge/push/integration/ios.md +29 -40
  107. package/resource/knowledge/push/integration/react-native.md +1 -1
  108. package/resource/knowledge/push/integration/uni-app.md +1 -1
  109. package/resource/knowledge/push/integration/unity.md +4 -4
  110. package/resource/knowledge/push/integration/unreal-engine.md +9 -9
  111. package/resource/knowledge/roomkit/core-sdk/android/room-state.md +6 -6
  112. package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +13 -13
  113. package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +5 -5
  114. package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +4 -4
  115. package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +6 -6
  116. package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +4 -4
  117. package/resource/knowledge/roomkit/core-sdk/vue/device-detection.md +0 -9
  118. package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
  119. package/resource/knowledge/roomkit/core-sdk/vue/recording.md +3 -3
  120. package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -3
  121. package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -16
  122. package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +0 -3
  123. package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +3 -6
  124. package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +0 -15
  125. package/resource/knowledge/roomkit/preset/android/integration.md +5 -202
  126. package/resource/knowledge/roomkit/preset/flutter/integration.md +17 -13
  127. package/resource/knowledge/roomkit/preset/harmonyos/integration.md +10 -2
  128. package/resource/knowledge/roomkit/preset/ios/integration.md +7 -204
  129. package/resource/knowledge/roomkit/preset/react/integration.md +0 -202
  130. package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +244 -500
  131. package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +25 -6
  132. package/server.js +1 -1
  133. package/utils/preflight-route.js +203 -185
  134. package/utils/report-cls-client.js +1 -1
  135. package/utils/report-es-client.js +1 -1
@@ -1,1021 +1,283 @@
1
1
  TUIKit 是基于 IM SDK 的一款 UI 组件库,可通过 UI 组件快速实现聊天、会话、搜索、关系链、群组等功能。本文介绍如何快速集成 TUIKit 并实现核心功能。
2
2
 
3
- ## 关键概念
4
- - **经典版 UI**:从 5.7.1435 版本开始,TUIKit 支持模块化集成,支持了经典版 UI(类微信 UI)。
3
+ ## 集成 TUIKit
5
4
 
6
- - **简约版 UI**:从 6.9.3557 版本开始,TUIKit 新增了全新的简约版 UI(类 WhatsApp UI)。
5
+ TUIKit 采用数据驱动的响应式架构与原生 iOS UIKit 体系(非声明式 UI ),以源码方式开放集成。它提供会话列表、聊天、联系人、搜索、群组等完整 UI 能力。
7
6
 
8
- 您可以根据需求自由选择经典版或简约版 UI 组件。如果您还不了解各个界面库的功能,可以查阅文档 [TUIKit 界面库介绍](https://cloud.tencent.com/document/product/269/37190)。
7
+ ### 前提条件
8
+ - **Xcode**:16.0 或以上版本(推荐 Xcode 16.x 系列)。
9
9
 
10
- ## 前提条件
11
- - Xcode 15 及以上
10
+ - **iOS**:14.0 及以上真机(暂时不支持模拟器)。
12
11
 
13
- - iOS 14.0 及以上
12
+ - **CocoaPods**:1.12.0 及以上版本(推荐 1.16.x)。如尚未安装,请参考 [CocoaPods Getting Started](https://guides.cocoapods.org/using/getting-started.html) 进行安装。
14
13
 
15
14
  - 一个有效的腾讯云账号及 Chat 应用。可参考 开通服务 从控制台获取以下信息:
16
15
 
17
- - SDKAppID:App 在控制台获取的 Chat 应用的 ID,为应用的唯一标识。
16
+ - SDKAppID:App 在控制台获取的 Chat 应用的 ID,为应用的唯一标识。
18
17
 
19
- - SDKSecretKey:应用的密钥。
18
+ - SDKSecretKey:应用的密钥。
20
19
 
21
- ## CocoaPods 集成
20
+ ## 集成并引入组件
22
21
 
23
- > **消息引用与回复功能的版本兼容性:**
24
- >
25
- > 自 9.0.7652 版本起:
26
- >
27
- > - **消息引用(Quote)**改用 IMSDK 原生引用能力实现,与旧版本引用消息格式不兼容。新旧版本互发的引用消息无法正确解析引用内容,请将收发双方统一升级至 9.0.7652 及以上版本。
28
- > - **消息回复(Reply)**功能已下线,相关接口与 UI 入口不再提供,如业务有相关需求,可参考旧版本 TUIKit 自行实现。
29
- > **两者区别:引用是发送新消息时附带一条历史消息的摘要卡片,点击可跳转原消息(一问一答);回复是在某条消息下追加评论并聚合成回复列表(评论区式)。**
30
- >
31
-
32
- 1. 安装 CocoaPods。
33
- 在终端窗口中输入如下命令(需要提前在 Mac 中安装 Ruby 环境):
34
-
35
- ``` bash
36
- sudo gem install cocoapods
37
- ```
38
- 2. 创建 Podfile 文件。
39
- 进入项目所在路径输入以下命令行,之后项目路径下会出现一个 Podfile 文件。
40
-
41
- ``` bash
42
- pod init
43
- ```
44
- 3. 根据业务需求在 Podfile 中添加对应的 TUIKit 组件。组件之间相互独立,添加或删除均不影响工程编译。您可以按需选择不同的 Podfile 集成方式:
45
-
46
- - 远程 CocoaPods 集成。
47
-
48
- - DevelopmentPods 本地集成。
49
-
50
- 上面两种集成方式的优缺点如下表所示:
51
-
52
- |集成方式|适合场景|优点|缺点|
53
- |---------|---------|---------|---------|
54
- |远程 CocoaPods 集成|适合无源码修改时的集成。|当 TUIKit 有版本更新时,您只需再次 `Pod update` 即可完成更新。|当您有源码修改,使用 `Pod update` 更新时,新版本的 TUIKit 会覆盖您的修改。|
55
- |本地 DevelopmentPods 集成|适合有涉及源码自定义修改的客户。|当您有自己的 git 仓库时,可以跟踪修改。修改源码后,使用 `Pod update` 更新其他远程 Pod 库时,不会覆盖您的修改。|您需要手动将 TUIKit 源码覆盖您本地 TUIKit 文件夹进行更新。|
56
-
57
- ### 远程 CocoaPods 集成
58
-
59
- 您可以在 Podfile 中按需添加组件库:
60
-
61
- > **注意:**
62
- > 从 8.5.6870 版本开始,TUIKit 支持 Swift 语言组件。
22
+ > **说明:**
23
+ > Demo:IM 在 [CNB](https://cnb.cool/tencent/cloud/trtc/TUIKit_iOS) 及 [GitHub](https://github.com/Tencent-RTC/TUIKit_iOS) 上提供即时通信完整 Demo,[5 分钟跑通聊天 + 音视频通话全功能](https://cloud.tencent.com/document/product/269/68228)。
63
24
  >
64
25
 
65
- 【经典版】
26
+ ### 下载源码
66
27
 
67
- 【Swift 组件】
28
+ 从 [CNB](https://cnb.cool/tencent/cloud/trtc/TUIKit_iOS) 或者 [GitHub](https://github.com/Tencent-RTC/TUIKit_iOS) 克隆 TUIKit iOS 源码
68
29
  ``` bash
69
- # Uncomment the next line to define a global platform for your project
70
- source 'https://github.com/CocoaPods/Specs.git'
71
- platform :ios, '14.0'
72
- # 防止 TUIKit 组件里的 *.xcassets 与您项目里面冲突。
73
- install! 'cocoapods', :disable_input_output_paths => true
74
-
75
- # 请使用您的真实项目名称替换 your_project_name
76
- target 'your_project_name' do
77
- use_frameworks!
78
- use_modular_headers!
79
-
80
- # 集成聊天功能
81
- pod 'TUIChat_Swift/UI_Classic'
82
- # 集成会话功能
83
- pod 'TUIConversation_Swift/UI_Classic'
84
- # 集成关系链功能
85
- pod 'TUIContact_Swift/UI_Classic'
86
- # 集成搜索功能(需要购买旗舰版或企业版套餐)
87
- pod 'TUISearch_Swift/UI_Classic'
88
- # 集成音视频通话功能
89
- pod 'TUICallKit_Swift'
90
- # 集成投票插件
91
- pod 'TUIPollPlugin_Swift'
92
- # 集成群接龙插件
93
- pod 'TUIGroupNotePlugin_Swift'
94
- # 集成翻译插件(需开通增值功能,请联系腾讯云商务开通)
95
- pod 'TUITranslationPlugin_Swift'
96
- # 集成会话分组插件
97
- pod 'TUIConversationGroupPlugin_Swift'
98
- # 集成会话标记插件
99
- pod 'TUIConversationMarkPlugin_Swift'
100
- # 集成语音转文字插件
101
- pod 'TUIVoiceToTextPlugin_Swift'
102
- # 集成文字转语音插件
103
- pod 'TUITextToVoicePlugin_Swift'
104
- # 集成公众号插件
105
- pod 'TUIOfficialAccountPlugin_Swift'
106
- # 集成表情回应插件
107
- pod 'TUIEmojiPlugin_Swift'
108
- end
30
+ # 从 CNB 中克隆代码
31
+ git clone https://cnb.cool/tencent/cloud/trtc/TUIKit_iOS.git
109
32
 
110
- #Pods config
111
- post_install do |installer|
112
- installer.pods_project.targets.each do |target|
113
- target.build_configurations.each do |config|
114
- #Fix Xcode14 Bundle target error
115
- config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
116
- config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
117
- config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
118
- config.build_settings['ENABLE_BITCODE'] = "NO"
119
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "14.0"
120
- #Fix Xcode15 other links flag -ld64
121
- xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
122
- if xcode_version >= 15
123
- xcconfig_path = config.base_configuration_reference.real_path
124
- xcconfig = File.read(xcconfig_path)
125
- if xcconfig.include?("OTHER_LDFLAGS") == false
126
- xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
127
- else
128
- if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
129
- xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
130
- end
131
- if xcconfig.include?("-ld64") == false
132
- xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
133
- end
134
- end
135
- File.open(xcconfig_path, "w") { |file| file << xcconfig }
136
- end
137
- end
138
- end
139
- end
33
+ # 从 GitHub 中克隆代码
34
+ git clone https://github.com/Tencent-RTC/TUIKit_iOS.git
140
35
  ```
141
36
 
142
- 【简约版】
143
-
144
- 【Swift 组件】
37
+ 将仓库根目录下的 `chat`、`call` 文件夹整体复制到您的工程根目录下。复制完成后的目录结构如下:
145
38
  ``` bash
146
- # Uncomment the next line to define a global platform for your project
147
- source 'https://github.com/CocoaPods/Specs.git'
148
- platform :ios, '14.0'
149
- # 防止 TUIKit 组件里的 *.xcassets 与您项目里面冲突。
150
- install! 'cocoapods', :disable_input_output_paths => true
151
-
152
- # 请使用您的真实项目名称替换 your_project_name
153
- target 'your_project_name' do
154
- use_frameworks!
155
- use_modular_headers!
156
-
157
- # 集成聊天功能
158
- pod 'TUIChat_Swift/UI_Minimalist'
159
- # 集成会话功能
160
- pod 'TUIConversation_Swift/UI_Minimalist'
161
- # 集成关系链功能
162
- pod 'TUIContact_Swift/UI_Minimalist'
163
- # 集成搜索功能(需要购买旗舰版或企业版、套餐)
164
- pod 'TUISearch_Swift/UI_Minimalist'
165
- # 集成音视频通话功能
166
- pod 'TUICallKit_Swift'
167
- # 集成翻译插件(需单独购买翻译插件)
168
- pod 'TUITranslationPlugin_Swift'
169
- # 集成语音转文字插件
170
- pod 'TUIVoiceToTextPlugin_Swift'
171
- # 集成表情回应插件
172
- pod 'TUIEmojiPlugin_Swift'
173
- end
174
- #Pods config
175
- post_install do |installer|
176
- installer.pods_project.targets.each do |target|
177
- target.build_configurations.each do |config|
178
- #Fix Xcode14 Bundle target error
179
- config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
180
- config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
181
- config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
182
- config.build_settings['ENABLE_BITCODE'] = "NO"
183
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "14.0"
184
- #Fix Xcode15 other links flag -ld64
185
- xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
186
- if xcode_version >= 15
187
- xcconfig_path = config.base_configuration_reference.real_path
188
- xcconfig = File.read(xcconfig_path)
189
- if xcconfig.include?("OTHER_LDFLAGS") == false
190
- xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
191
- else
192
- if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
193
- xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
194
- end
195
- if xcconfig.include?("-ld64") == false
196
- xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
197
- end
198
- end
199
- File.open(xcconfig_path, "w") { |file| file << xcconfig }
200
- end
201
- end
202
- end
203
- end
39
+ YourApplication/
40
+ ├── source/ # 您的工程代码
41
+ ├── call/ # 音视频通话组件
42
+ │ └── TUICallKit_Swift.podspec
43
+ │ └── TUICallKit_Swift/
44
+ ├── chat/ # Chat 源码
45
+ │ ├── demo/ # 示例工程
46
+ │ └── uikit/ # TUIChatKit 组件库
47
+ ├── Podfile # 依赖配置文件
48
+ ├── YourApplication.xcworkspace # 您的项目文件
204
49
  ```
205
50
 
206
51
  > **说明:**
207
- > 1. 如果您直接 `pod 'TUIChat'`,不指定经典版或简约版,默认会集成两套版本 UI 组件。
208
- > 2. 经典版和简约版 UI 不能混用,集成多个组件时,您必须同时全部选择经典版 UI 或简约版 UI。例如,经典版 `TUIChat` 组件必须与经典版 `TUIConversation`、`TUIContact` 组件搭配使用。同理,简约版 `TUIChat` 组件必须与简约版 `TUIConversation`、`TUIContact` 组件搭配使用。
209
-
210
- Podfile 修改完毕后,执行以下命令,安装 TUIKit 组件。
211
- ``` bash
212
- pod install
213
- ```
214
-
215
- 如果无法安装 TUIKit 最新版本,执行以下命令更新本地的 CocoaPods 仓库列表。
216
- ``` bash
217
- pod repo update
218
- ```
219
-
220
- 之后执行以下命令,更新组件库的 Pod 版本。
221
- ``` bash
222
- pod update
223
- ```
224
-
225
- 集成全部的 TUIKit 组件后的项目结构:
226
-
227
- ### 本地 DevelopmentPods 源码集成
228
-
229
- > **消息引用与回复功能的版本兼容性:**
230
- >
231
- > 自 9.0.7652 版本起:
232
- >
233
- > - 消息引用(Quote) 改用 IMSDK 原生引用能力实现,与旧版本引用消息格式不兼容。新旧版本互发的引用消息无法正确解析引用内容,请将收发双方统一升级至 9.0.7652 及以上版本。
234
- > - 消息回复(Reply) 功能已下线,相关接口与 UI 入口不再提供,如业务有相关需求,可参考旧版本 TUIKit 自行实现。
235
- > *两者区别:引用是发送新消息时附带一条历史消息的摘要卡片,点击可跳转原消息(一问一答);回复是在某条消息下追加评论并聚合成回复列表(评论区式)。*
52
+ > TUIKit_iOS 是包含多个产品的开源仓库,Chat 的 UI 源码位于 `chat/` 目录下(`chat/uikit` 为 UIKit 组件库,`chat/demo` 为示例工程),其依赖的音视频通话组件 `call/TUICallKit_Swift` 位于仓库根目录。模块目录可放在工程任意位置,只需在 `Podfile` 中设置正确的相对路径即可。
236
53
  >
237
54
 
238
- 1. 从 GitHub 下载 TUIKit 源码,将 TUIKit 目录直接拖入您的工程目录下:
55
+ ### 集成组件
56
+ 1. 在 Podfile 中引入对应模块(请按源码实际存放位置调整相对路径):
239
57
 
240
- - [Swift TUIKit 源码 GitHub 地址](https://github.com/Tencent-RTC/Chat_UIKit/tree/main/Swift/TUIKit):
241
-
242
- - [Objective-C TUIKit 源码 GitHub 地址](https://github.com/TencentCloud/TIMSDK/tree/master/iOS/TUIKit):
243
-
244
- 2. 修改您 Podfile 中每个组件的本地路径。path 是 TUIKit 文件夹相对于您工程 Podfile 文件的位置,常见的有:
245
-
246
- - TUIKit 文件夹位于您工程 Podfile 文件**父目录**: `pod 'TUICore', :path => "../TUIKit/TUICore"`
247
-
248
- - TUIKit 文件夹位于您工程 Podfile 文件**当前目录**: `pod 'TUICore', :path => "./TUIKit/TUICore"`
249
-
250
- - TUIKit 文件夹位于您工程 Podfile 文件**子目录**: `pod 'TUICore', :path => "/TUIKit/TUICore"`
251
-
252
- 以 TUIKit 文件夹位于您工程 Podfile 文件父目录为例:
253
-
254
- 【Development Podfile】
255
-
256
- 【Swift 组件】
257
- ``` bash
258
- # Uncomment the next line to define a global platform for your project
259
- source 'https://github.com/CocoaPods/Specs.git'
260
- platform :ios, '14.0'
261
- install! 'cocoapods', :disable_input_output_paths => true
262
-
263
- # 请使用您的真实项目名称替换 your_project_name
264
- target 'your_project_name' do
265
- # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
266
- use_frameworks!
267
- use_modular_headers!
268
-
269
- # 集成基础库(必选)
270
- pod 'TUICore', :path => "../TUIKit/TUICore"
271
- pod 'TIMCommon_Swift', :path => "../TUIKit/TIMCommon"
272
- # 集成TUIKit组件(可选)
273
- # 集成聊天功能
274
- pod 'TUIChat_Swift', :path => "../TUIKit/TUIChat"
275
- # 集成会话功能
276
- pod 'TUIConversation_Swift', :path => "../TUIKit/TUIConversation"
277
- # 集成关系链功能
278
- pod 'TUIContact_Swift', :path => "../TUIKit/TUIContact"
279
- # 集成搜索功能(需要购买旗舰版或企业版套餐)
280
- pod 'TUISearch_Swift', :path => "../TUIKit/TUISearch"
281
-
282
- # 集成音视频通话功能
283
- pod 'TUICallKit_Swift'
284
-
285
- # 集成 TUIKitPlugin 插件 (可选)
286
- # 集成翻译插件(需单独购买插件)
287
- pod 'TUITranslationPlugin_Swift'
288
- # 集成语音转文字插件(需单独购买插件)
289
- pod 'TUIVoiceToTextPlugin_Swift'
290
-
291
- # 其他 Pod
292
- pod 'MJRefresh'
293
- pod 'SnapKit'
294
- end
295
- #Pods config
296
- post_install do |installer|
297
- installer.pods_project.targets.each do |target|
298
- target.build_configurations.each do |config|
299
- #Fix Xcode14 Bundle target error
300
- config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
301
- config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
302
- config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
303
- config.build_settings['ENABLE_BITCODE'] = "NO"
304
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "14.0"
305
- #Fix Xcode15 other links flag -ld64
306
- xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
307
- if xcode_version >= 15
308
- xcconfig_path = config.base_configuration_reference.real_path
309
- xcconfig = File.read(xcconfig_path)
310
- if xcconfig.include?("OTHER_LDFLAGS") == false
311
- xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
312
- else
313
- if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
314
- xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
315
- end
316
- if xcconfig.include?("-ld64") == false
317
- xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
318
- end
319
- end
320
- File.open(xcconfig_path, "w") { |file| file << xcconfig }
321
- end
322
- end
323
- end
324
- end
325
- ```
58
+ ``` bash
59
+ # 请使用您的真实项目名称替换 your_project_name
60
+ target 'your_project_name' do
326
61
 
327
- 【Objective-C 组件】
328
- ``` bash
329
- # Uncomment the next line to define a global platform for your project
330
- source 'https://github.com/CocoaPods/Specs.git'
331
- platform :ios, '14.0'
332
- install! 'cocoapods', :disable_input_output_paths => true
333
-
334
- # 请使用您的真实项目名称替换 your_project_name
335
- target 'your_project_name' do
336
- # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
337
- use_frameworks!
338
- use_modular_headers!
339
-
340
- # 集成基础库(必选)
341
- pod 'TUICore', :path => "../TUIKit/TUICore"
342
- pod 'TIMCommon', :path => "../TUIKit/TIMCommon"
343
- # 集成TUIKit组件(可选)
344
- # 集成聊天功能
345
- pod 'TUIChat', :path => "../TUIKit/TUIChat"
346
- # 集成会话功能
347
- pod 'TUIConversation', :path => "../TUIKit/TUIConversation"
348
- # 集成关系链功能
349
- pod 'TUIContact', :path => "../TUIKit/TUIContact"
350
- # 集成搜索功能(需要购买旗舰版或企业版套餐)
351
- pod 'TUISearch', :path => "../TUIKit/TUISearch"
352
-
353
- # 集成音视频通话功能
354
- pod 'TUICallKit_Swift'
355
- # 集成快速会议
356
- pod 'TUIRoomKit'
357
-
358
- # 集成TUIKitPlugin插件 (可选)
359
- # 集成翻译插件,从 7.2 版本开始支持(需单独购买翻译插件)
360
- pod 'TUITranslationPlugin'
361
- # 集成推送插件
362
- pod 'TIMPush'
363
-
364
- # 其他 Pod
365
- pod 'MJRefresh'
366
- pod 'Masonry'
367
- end
368
- #Pods config
369
- post_install do |installer|
370
- installer.pods_project.targets.each do |target|
371
- target.build_configurations.each do |config|
372
- #Fix Xcode14 Bundle target error
373
- config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
374
- config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
375
- config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
376
- config.build_settings['ENABLE_BITCODE'] = "NO"
377
- config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "14.0"
378
- #Fix Xcode15 other links flag -ld64
379
- xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
380
- if xcode_version >= 15
381
- xcconfig_path = config.base_configuration_reference.real_path
382
- xcconfig = File.read(xcconfig_path)
383
- if xcconfig.include?("OTHER_LDFLAGS") == false
384
- xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
385
- else
386
- if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
387
- xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
388
- end
389
- if xcconfig.include?("-ld64") == false
390
- xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
391
- end
392
- end
393
- File.open(xcconfig_path, "w") { |file| file << xcconfig }
394
- end
395
- end
396
- end
397
- end
398
- ```
62
+ # 补充如下内容 增加 TUIChatKit 和 TUICallKit_Swift 这两个依赖
63
+ # 注意 path 的相对路径
64
+ pod 'TUIChatKit', :path => 'chat/uikit/TUIChatKit.podspec'
65
+ pod 'TUICallKit_Swift', :path => 'call/TUICallKit_Swift.podspec'
66
+ end
399
67
 
400
- 3. Podfile 修改完毕后,执行以下命令,安装本地 TUIKit 组件。示例:
68
+ ```
69
+ 2. Podfile 修改完毕后,执行以下命令,安装 TUIKit 组件。
401
70
 
402
71
  ``` bash
403
72
  pod install
404
- ```
405
-
406
- > **注意:**
407
- >
408
- > 1. 使用本地集成方案时,如需升级时需要从 GitHub 获取最新的组件代码,覆盖您本地项目的 TUIKit 目录。
409
- > 2. 当私有化修改和远端有冲突时,需要手动合并,处理冲突。
410
- > 3. TUIKit 插件需要依赖 TUICore 的版本,请确保插件版本和 "../TUIKit/TUICore/TUICore.spec" 中的 spec.version 一致。
411
-
412
- ## 第三方库依赖
413
73
 
414
- TUIKit 依赖的第三方库的最低版本如下,如果您的版本较低,请升级到最新版本。
74
+ # 如果无法安装 TUIKit 最新版本,执行以下命令更新本地的 CocoaPods 仓库列表。
75
+ # pod repo update
76
+ # pod update
415
77
 
416
- 【Swift 组件】
417
- ``` plaintext
418
- - MJExtension (3.4.1)
419
- - MJRefresh (3.7.5)
420
- - SnapKit (5.7.1)
421
- - SSZipArchive (2.4.3)
422
- - SDWebImage (5.18.11)
423
- ```
424
-
425
- 【Objective-C 组件】
426
- ``` plaintext
427
- - Masonry (1.1.0)
428
- - MJExtension (3.4.1)
429
- - MJRefresh (3.7.5)
430
- - ReactiveObjC (3.1.1)
431
- - SDWebImage (5.18.11):
432
- - SDWebImage/Core (= 5.18.11)
433
- - SDWebImage/Core (5.18.11)
434
- - SnapKit (5.6.0)
435
- - SSZipArchive (2.4.3)
436
- ```
78
+ ```
437
79
 
438
80
  ## 接入步骤
439
81
 
440
- 常用的聊天软件都是由会话列表、聊天窗口、好友列表、音视频通话等几个基本的界面组成,参考下面步骤,您仅需几行代码即可在项目中快速搭建这些 UI 界面。 实操教学(Objective-C 组件版本)视频请参见:[极速集成 TUIKit(iOS)](https://cloud.tencent.com/edu/learning/quick-play/3130-82618)。
82
+ 完成上述集成后,参考以下步骤,您仅需几行代码即可在项目中快速搭建会话列表、聊天、联系人等核心界面。
441
83
 
442
84
  ### 步骤1:配置用户鉴权
443
85
 
444
- SDKAppID 需要在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im) 创建并获取,userSig 需要按规则计算,详细步骤请参考文档 [跑通 Demo](https://cloud.tencent.com/document/product/269/68228)。
86
+ 在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im/tool-usersig) 根据 UserID 获取 UserSig,用于后续登录时的用户鉴权。
445
87
 
446
88
  ### 步骤2:用户登录
447
89
 
448
- 登录组件后才能正常使用组件的功能。用户在 App 上点击登录时,您可以登录 TUIKit 组件。
449
-
450
- 示例代码如下所示:
451
-
452
- 【Swift】
453
- ``` swift
454
- import TUICore
455
- @objc func loginSDK(_ userID: String, userSig: String, succ: TSucc?, fail: TFail?) {
456
- TUILogin.login(Int32(SDKAPPID), userID: userID, userSig: userSig, config: loginConfig, succ: {
457
- // update UI
458
- succ?()
459
- }, fail: { code, msg in
460
- // update UI
461
- fail?(code, msg)
462
- })
463
- }
464
- ```
465
-
466
- 【Objective-C】
467
- ``` objectivec
468
- #import "TUILogin.h"
469
-
470
- - (void)loginSDK:(NSString *)userID userSig:(NSString *)sig succ:(TSucc)succ fail:(TFail)fail {
471
- [TUILogin login:SDKAppID userID:userID userSig:sig succ:^{
472
- NSLog(@"登录成功");
473
- } fail:^(int code, NSString *msg) {
474
- NSLog(@"登录失败");
475
- }];
476
- }
477
- ```
478
-
479
- ### 步骤3:构建会话列表界面
480
-
481
- 会话列表只需要创建 `TUIConversationListController` 对象即可。会话列表会从数据库中读取最近联系人,当用户点击联系人时,`TUIConversationListController` 将事件 `didSelectConversation` 回调给上层。
482
-
483
- 示例代码如下所示:
484
-
485
- 【经典版】
90
+ 登录鉴权后才能正常使用组件的功能。调用 `LoginStore` 的 `login` 接口,传入上文获取的 sdkAppID、userID、userSig 进行登录鉴权:
486
91
 
487
92
  【Swift】
488
93
  ``` swift
94
+ import AtomicXCore
95
+ import TUIChatKit
489
96
  import UIKit
490
- import TUICore
491
- import ImSDK_Plus
492
- import TIMCommon
493
- import TUIConversation
494
- // ConversationController 为您自己的 ViewController
495
- public class ConversationController: UIViewController, V2TIMSDKListener, TUIPopViewDelegate {
496
- private var conv: TUIConversationListController?
497
- override public func viewDidLoad() {
498
- super.viewDidLoad()
499
- setupNavigation()
500
- conv = TUIConversationListController()
501
- if let conv = conv {
502
- addChild(conv)
503
- view.addSubview(conv.view)
504
- }
505
- }
506
- }
507
- // 会话列表点击事件,可自定义,通常是打开聊天界面
508
- public protocol TUIConversationListControllerListener: AnyObject {
509
- func conversationListController(_ conversationController: UIViewController, didSelectConversation conversation: TUIConversationCellData) -> Bool
510
- }
511
- ```
512
-
513
- 【Objective-C】
514
- ``` objectivec
515
- #import "TUIConversationListController.h"
516
-
517
- // ConversationController 为您自己的 ViewController
518
- @implementation ConversationController
519
- - (void)viewDidLoad {
520
- [super viewDidLoad];
521
- // TUIConversationListController
522
- TUIConversationListController *vc = [[TUIConversationListController alloc] init];
523
- vc.delegate = self;
524
- // 把 TUIConversationListController 添加到自己的 ViewController
525
- [self addChildViewController:vc];
526
- [self.view addSubview:vc.view];
527
- }
528
-
529
- - (void)conversationListController:(UIViewController *)conversationController
530
- didSelectConversation:(TUIConversationCellData *)conversation {
531
- // 会话列表点击事件,可自定义,通常是打开聊天界面
532
- }
533
- @end
534
- ```
535
97
 
536
- 【简约版】
537
-
538
- 【Swift】
539
- ``` swift
540
- // ConversationController 为您自己的 ViewController
541
- public class ConversationController: UIViewController, V2TIMSDKListener, TUIPopViewDelegate {
542
- override public func viewDidLoad() {
543
- super.viewDidLoad()
544
- setupNavigation()
545
-
546
- conv = TUIConversationListController_Minimalist()
547
- if let conv = conv {
548
- addChild(conv)
549
- view.addSubview(conv.view)
98
+ let yourSdkAppID: Int32 = 10_000_000_00 // 填写你的实际sdkAppID
99
+ let testUserID = "testUserID" // 你的测试用户ID
100
+ let userSig = "xxxxxxx" // 你的测试用户ID对应的 userSig (从IM 控制台获取,看上面的截图)
101
+
102
+ LoginStore.shared.login(sdkAppID: yourSdkAppID, userID: testUserID, userSig: userSig) { [weak self] result in
103
+ DispatchQueue.main.async {
104
+ switch result {
105
+ case .success:
106
+ // 登录成功后 显示会话列表
107
+ // self?.showConversationList()
108
+ case .failure(let error):
109
+ print("login failed: \(error.code) \(error.message)")
550
110
  }
551
111
  }
552
112
  }
553
- // 会话列表点击事件,可自定义,通常是打开聊天界面
554
- public protocol TUIConversationListControllerListener: AnyObject {
555
- func conversationListController(_ conversationController: UIViewController, didSelectConversation conversation: TUIConversationCellData) -> Bool
556
- }
557
113
  ```
558
114
 
559
- 【Objective-C】
560
- ``` objectivec
561
- #import "TUIConversationListController_Minimalist.h"
562
-
563
- // ConversationController 为您自己的 ViewController
564
- @implementation ConversationController
565
- - (void)viewDidLoad {
566
- [super viewDidLoad];
567
- // TUIConversationListController_Minimalist
568
- TUIConversationListController_Minimalist *vc = [[TUIConversationListController_Minimalist alloc] init];
569
- vc.delegate = self;
570
- // 把 TUIConversationListController_Minimalist 添加到自己的 ViewController
571
- [self addChildViewController:vc];
572
- [self.view addSubview:vc.view];
573
- }
574
-
575
- - (void)conversationListController:(TUIConversationListController_Minimalist *)conversationController
576
- didSelectConversation:(TUIConversationCell *)conversation
577
- {
578
- // 会话列表点击事件,通常是打开聊天界面
579
- }
580
- @end
581
- ```
582
-
583
- ### 步骤4:构建聊天界面
584
-
585
- 初始化聊天界面时,需要上层传入当前聊天界面对应的会话信息。
115
+ > **警告:**
116
+ > 在正式的生产环境中,建议在您的服务端生成 UserSig,在需要时由 App 向业务服务器发起请求获取动态 UserSig 进行鉴权。详见 [服务端生成 UserSig](https://cloud.tencent.com/document/product/269/32688)。
117
+ >
586
118
 
587
- 示例代码如下所示:
119
+ ### 步骤3:构建会话列表界面
588
120
 
589
- 【经典版】
121
+ 登录成功后(步骤 2),即可展示会话列表。只需创建 `ConversationsPage` 对象,并将其 push 到导航控制器:
590
122
 
591
123
  【Swift】
592
- ``` swift
124
+ ``` java
125
+ import AtomicXCore
126
+ import TUIChatKit
593
127
  import UIKit
594
- import TUICore
595
- import TIMCommon
596
- import TUIChat
597
-
598
- let conversationData = TUIChatConversationModel()
599
- conversationData.userID = userID ?? ""
600
- conversationData.groupID = groupID ?? ""
601
- if let chatVC = getChatViewController(conversationData) {
602
- navigationController?.pushViewController(chatVC, animated: true)
603
- }
604
128
 
605
- private func getChatViewController(_ model: TUIChatConversationModel) -> TUIBaseChatViewController? {
606
- var chat: TUIBaseChatViewController?
607
- if let userID = model.userID, !userID.isEmpty {
608
- chat = TUIC2CChatViewController()
609
- } else if let groupID = model.groupID, !groupID.isEmpty {
610
- chat = TUIGroupChatViewController()
611
- }
612
- chat?.conversationData = model
613
- return chat
129
+ func showConversationList() {
130
+ let conversationsPage = ConversationsPage(onConversationClick: { [weak self] info in
131
+ // 点击会话列表中的某条会话后,进入对应的聊天页
132
+ // self?.showChat(info.conversation)
133
+ })
134
+ navigationController.pushViewController(conversationsPage, animated: true)
614
135
  }
615
136
  ```
616
137
 
617
- 【Objective-C】
618
- ``` objectivec
619
- #import "TUIC2CChatViewController.h"
620
-
621
- // ChatViewController 为您自己的 ViewController
622
- @implementation ChatViewController
623
- - (void)viewDidLoad {
624
- // 创建会话信息
625
- TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
626
- data.userID = @"userID";
627
- // TUIC2CChatViewController
628
- TUIC2CChatViewController *vc = [[TUIC2CChatViewController alloc] init];
629
- [vc setConversationData:data];
630
- // 把 TUIC2CChatViewController 添加到自己的 ViewController
631
- [self addChildViewController:vc];
632
- [self.view addSubview:vc.view];
633
- }
634
- @end
635
- ```
138
+ `ConversationsPage` 会自动从本地数据库加载最近会话。当用户点击某条会话时,`ConversationsPage` 会通过 `onConversationClick` 回调,把所选会话的信息传递给上层,您可以在该回调中创建并进入聊天页(见 步骤 4)。
636
139
 
637
- > **说明:**
638
- > `TUIC2CChatViewController` 会自动拉取该用户的历史消息并展示出来。
639
- >
140
+ ### 步骤4:构建聊天界面
640
141
 
641
- 【简约版】
142
+ 聊天页由 ChatPage 承载,负责消息的展示与收发。构造 ChatPage 时必须传入一个 `ConversationInfo`,用于指定要进入的会话。其中 `conversationID` 与 `type` 是必填的关键字段,title 用于聊天页导航栏标题的初始展示。
642
143
 
643
144
  【Swift】
644
145
  ``` swift
645
- let conversationData = TUIChatConversationModel()
646
- conversationData.userID = userID ?? ""
647
- conversationData.groupID = groupID ?? ""
648
- if let chatVC = getChatViewController(conversationData) {
649
- navigationController?.pushViewController(chatVC, animated: true)
650
- }
651
-
652
- private func getChatViewController(_ model: TUIChatConversationModel) -> TUIBaseChatViewController_Minimalist? {
653
- var chat: TUIBaseChatViewController_Minimalist?
654
- if let userID = model.userID, !userID.isEmpty {
655
- chat = TUIC2CChatViewController_Minimalist()
656
- } else if let groupID = model.groupID, !groupID.isEmpty {
657
- chat = TUIGroupChatViewController_Minimalist()
658
- }
659
- chat?.conversationData = model
660
- return chat
661
- }
662
- ```
146
+ import AtomicXCore
147
+ import TUIChatKit
148
+ import UIKit
663
149
 
664
- 【Objective-C】
665
- ``` objectivec
666
- #import "TUIC2CChatViewController_Minimalist.h"
667
-
668
- // ChatViewController 为您自己的 ViewController
669
- @implementation ChatViewController
670
- - (void)viewDidLoad {
671
- // 创建会话信息
672
- TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
673
- data.userID = @"userID";
674
- // 创建 TUIC2CChatViewController_Minimalist
675
- TUIC2CChatViewController_Minimalist *vc = [[TUIC2CChatViewController_Minimalist alloc] init];
676
- [vc setConversationData:data];
677
- // 把 TUIC2CChatViewController 添加到自己的 ViewController
678
- [self addChildViewController:vc];
679
- [self.view addSubview:vc.view];
150
+ // 进入单聊
151
+ let userID = "test_user"
152
+ var conversation = ConversationInfo(conversationID: ChatUtil.getC2CConversationID(userID))
153
+ conversation.type = .c2c
154
+ conversation.title = "与 \(userID) 聊天"
155
+ showChat(conversation)
156
+
157
+ // 进入群聊
158
+ let groupID = "@TGS#xxxxxx"
159
+ var groupConversation = ConversationInfo(conversationID: ChatUtil.getGroupConversationID(groupID))
160
+ groupConversation.type = .group
161
+ groupConversation.title = "测试群"
162
+ showChat(groupConversation)
163
+
164
+ func showChat(_ info: ConversationInfo) {
165
+ let chatPage = ChatPage(conversation: info, onBack: { [weak self] in
166
+ self?.navigationController.popViewController(animated: true)
167
+ })
168
+ navigationController.pushViewController(chatPage, animated: true)
680
169
  }
681
- @end
682
170
  ```
683
171
 
684
- > **说明**
685
- >
686
- > `TUIC2CChatViewController_Minimalist` 会自动拉取该用户的历史消息并展示出来。
172
+ > **注意:**
173
+ > 在聊天界面使用 相册/录像/视频通话等需要声明对应的权限,请在 App 的 Info.plist 中声明如下权限:
687
174
  >
688
175
 
689
- ### 步骤5:构建联系人界面
176
+ > `<key>NSCameraUsageDescription</key>`
177
+ > `<string>需要访问您的相机权限,开启后才能发送图片或视频</string>`
178
+ > `<key>NSMicrophoneUsageDescription</key>`
179
+ > `<string>需要访问您的麦克风权限,开启后才能发送语音</string>`
180
+ > `<key>NSPhotoLibraryAddUsageDescription</key>`
181
+ > `<string>需要访问您的相册权限,开启后保存图片或视频</string>`
182
+ > `<key>NSPhotoLibraryUsageDescription</key>`
183
+ > `<string>需要访问您的相册权限,开启后才能发送图片或视频</string>`
690
184
 
691
- 联系人列表界面不需要其它依赖,只需创建对象并显示出来即可。
185
+ ### 步骤5:构建联系人界面
692
186
 
693
- 【经典版】
187
+ 联系人页由 ContactsPage 承载,展示当前用户的好友列表(按字母索引分组)与群列表入口 等。页面自带导航栏,右上角的 **+**按钮内置了**添加好友**和**加入群聊**两个功能入口。
694
188
 
695
189
  【Swift】
696
190
  ``` swift
191
+ import AtomicXCore
192
+ import TUIChatKit
697
193
  import UIKit
698
- import TUICore
699
- import TIMCommon
700
- import TUIContact
701
- // ContactController 为您自己的 ViewController
702
- public class ContactsController: UIViewController, TUIPopViewDelegate {
703
- var contactVC: TUIContactController?
704
- override public func viewDidLoad() {
705
- super.viewDidLoad()
706
-
707
- contactVC = TUIContactController()
708
- if let contactVC = contactVC {
709
- addChild(contactVC)
710
- view.addSubview(contactVC.view)
194
+
195
+ func showContacts() {
196
+ let contactsPage = ContactsPage(
197
+ onContactClick: { [weak self] contact in
198
+ // 点击好友列表中的某个联系人回调(ContactInfo),可在该回调中进入单聊
199
+ // self?.showChat(with: contact.userID, title: contact.nickname ?? contact.userID)
200
+ },
201
+ onGroupClick: { [weak self] group in
202
+ // 点击群列表中的某个群的回调(GroupInfo),可在该回调中进入群聊
203
+ // self?.showGroupChat(with: group.groupID, title: group.groupName)
711
204
  }
712
- }
205
+ )
206
+ navigationController.pushViewController(contactsPage, animated: true)
713
207
  }
714
208
  ```
715
209
 
716
- 【Objective-C】
717
- ``` objectivec
718
- #import "TUIContactController.h"
719
-
720
- // ContactController 为您自己的 ViewController
721
- @implementation ContactController
722
- - (void)viewDidLoad {
723
- // 创建 TUIContactController
724
- TUIContactController *vc = [[TUIContactController alloc] init];
725
- // 把 TUIContactController 添加到自己的 ViewController
726
- [self addChildViewController:vc];
727
- [self.view addSubview:vc.view];
728
- }
729
- @end
730
- ```
210
+ ### 步骤 6:音视频通话
731
211
 
732
- 注意,上面代码只能将 `TUIContactController` 初始化并展示出来,其中的点击行为(例如点击好友、添加好友等),TUIKit 会通过 `TUIContactControllerListener` 抛给上层处理:
212
+ 音视频通话能力由 TUICallKit_Swift 组件提供(Podfile 中需添加 pod 'TUICallKit_Swift')。
213
+ 1. **开通音视频通话服务,请参考** [**开通音视频服务**](https://cloud.tencent.com/document/product/269/104815)**。**
733
214
 
734
- 【Swift】
735
- ``` swift
736
- import TUIContact
737
- protocol TUIContactControllerListener: NSObjectProtocol {
738
- func onSelectFriend(_ cell: TUICommonContactCell) -> Bool
739
- func onAddNewFriend(_ cell: TUICommonTableViewCell) -> Bool
740
- func onGroupConversation(_ cell: TUICommonTableViewCell) -> Bool
741
- }
742
-
743
- ```
215
+ 2. **登录成功后初始化通话引擎。**
744
216
 
745
- 【Objective-C】
746
- ``` objectivec
747
- #import “TUIContactController.h”
748
- @protocol TUIContactControllerListener <NSObject>
749
- @optional
750
- - (void)onSelectFriend:(TUICommonContactCell *)cell;
751
- - (void)onAddNewFriend:(TUICommonTableViewCell *)cell;
752
- - (void)onGroupConversation:(TUICommonTableViewCell *)cell;
753
- @end
754
- ```
755
-
756
- 【简约版】
217
+ `LoginStore` 登录只建立了消息通道,在登录成功后,通话引擎需单独初始化:
757
218
 
758
219
  【Swift】
759
220
  ``` swift
760
- // ContactController 为您自己的 ViewController
761
- public class ContactsController: UIViewController, TUIPopViewDelegate {
762
- override public func viewDidLoad() {
763
- super.viewDidLoad()
764
-
765
- contactVC = TUIContactController_Minimalist()
766
- if let contactVC = contactVC {
767
- addChild(contactVC)
768
- view.addSubview(contactVC.view)
769
- }
770
- }
771
- }
772
- ```
773
221
 
774
- 【Objective-C】
775
- ``` objectivec
776
- #import "TUIContactController_Minimalist.h"
777
-
778
- // ContactController 为您自己的 ViewController
779
- @implementation ContactController
780
- - (void)viewDidLoad {
781
- // 创建 TUIContactController_Minimalist
782
- TUIContactController_Minimalist *vc = [[TUIContactController_Minimalist alloc] init];
783
- // 把 TUIContactController_Minimalist 添加到自己的 ViewController
784
- [self addChildViewController:vc];
785
- [self.view addSubview:vc.view];
786
- }
787
- @end
788
- ```
222
+ import RTCRoomEngine
223
+ import TUICallKit_Swift
789
224
 
790
- 注意,上面代码只能将 `TUIContactController_Minimalist` 初始化并展示出来,其中的点击行为(例如点击好友、添加好友等),TUIKit 会通过 `TUIContactControllerListener_Minimalist` 抛给上层处理:
225
+ func initCallEngine() {
226
+ let youSdkAppID: Int32 = 10_000_000_00 // 填写你的实际sdkAppID
227
+ let testUserID = "testUserID" // 你的测试用户ID
228
+ let userSig = "xxxxxxx" // 你的测试用户ID对应的 userSig (从IM 控制台获取,看上面的截图)
791
229
 
792
- 【Swift】
793
- ``` swift
794
- protocol TUIContactControllerListener_Minimalist: AnyObject {
795
- func onSelectFriend(_ cell: TUICommonContactCell_Minimalist) -> Bool
796
- func onAddNewFriend(_ cell: TUICommonTableViewCell) -> Bool
797
- func onGroupConversation(_ cell: TUICommonTableViewCell) -> Bool
230
+ TUICallEngine.createInstance().`init`(youSdkAppID, userId: testUserID, userSig: userSig) {
231
+ // enableIncomingBanner(true) 用于开启被叫时的来电横幅通知
232
+ TUICallKit.createInstance().enableIncomingBanner(enable: true)
233
+ } fail: { code, message in
234
+ print("initCallEngine failed: \(code), \(message ?? "")")
235
+ }
798
236
  }
799
- ```
800
237
 
801
- 【Objective-C】
802
- ``` objectivec
803
- @protocol TUIContactControllerListener_Minimalist <NSObject>
804
- @optional
805
- - (void)onSelectFriend:(TUICommonContactCell *)cell;
806
- - (void)onAddNewFriend:(TUICommonTableViewCell *)cell;
807
- - (void)onGroupConversation:(TUICommonTableViewCell *)cell;
808
- @end
809
238
  ```
810
239
 
811
- 例如单击好友后,您可以将好友信息页展示出来:
812
-
813
- 【经典版】
240
+ 3. **发起通话。**
814
241
 
815
242
  【Swift】
816
243
  ``` swift
817
- import TIMCommon
818
- import TUICore
819
- import UIKit
820
- @objc private func onSelectFriend(_ cell: TUICommonContactCell) {
821
- if let delegate = delegate {
822
- if delegate.onSelectFriend(cell) { return }
823
- }
824
- let data = cell.contactData
825
- let vc = TUIFriendProfileController(style: .grouped)
826
- vc.friendProfile = data?.friendProfile
827
- navigationController?.pushViewController(vc, animated: true)
244
+ func startVideoCall() {
245
+ TUICallKit.createInstance().calls(
246
+ userIdList: ["liu100"], // 被叫用户 ID 列表。单人通话传一个元素;传多个则为群组通话
247
+ mediaType: .video, // 通话类型:.video 视频通话、.audio 语音通话
248
+ params: nil,
249
+ completion: nil
250
+ )
828
251
  }
829
252
  ```
830
253
 
831
- 【Objective-C】
832
- ``` objectivec
833
- #import "TUIFriendProfileController.h"
834
-
835
- - (void)onSelectFriend:(TUICommonContactCell *)cell
836
- {
837
- TUICommonContactCellData *data = cell.contactData;
838
- // 创建好友资料 vc
839
- TUIFriendProfileController *vc = [[TUIFriendProfileController alloc] init];
840
- vc.friendProfile = data.friendProfile;
841
- // 展示好友资料 vc
842
- [self.navigationController pushViewController:(UIViewController *)vc animated:YES];
843
- }
844
- ```
254
+ 调用后 TUICallKit 会自动弹出全屏通话界面(含呼叫等待、接通、挂断全流程 UI),无需自行实现。
845
255
 
846
- 【简约版】
256
+ 4. **如何移除音视频通话功能?**
257
+
258
+ ChatPage 默认集成了音视频通话功能,如果你不需要音视频通话功能。可以在 步骤 4 创建聊天界面 中关闭音视频通话开关,代码如下所示:
847
259
 
848
260
  【Swift】
849
261
  ``` swift
850
- @objc func onSelectFriend(_ cell: TUICommonContactCell_Minimalist) {
851
- if let delegate = delegate {
852
- if delegate.onSelectFriend(cell) { return }
262
+ func showChat(_ info: ConversationInfo) {
263
+ // 在输入配置中关闭输入面板中的视频通话和音频通话功能
264
+ let inputConfig = ChatMessageInputConfig(isShowVideoCall: false, isShowAudioCall: false)
265
+ let chatPage = ChatPage(conversation: info, messageInputConfig: inputConfig, onBack: { [weak self] in
266
+ self?.navigationController.popViewController(animated: true)
267
+ })
268
+ navigationController.pushViewController(chatPage, animated: true)
853
269
  }
854
- let data = cell.contactData
855
- let vc = TUIFriendProfileController_Minimalist()
856
- vc.friendProfile = data?.friendProfile
857
- navigationController?.pushViewController(vc, animated: true)
858
- }
859
270
  ```
860
271
 
861
- 【Objective-C】
862
- ``` objectivec
863
- #import "TUIFriendProfileController_Minimalist.h"
864
-
865
- - (void)onSelectFriend:(TUICommonContactCell *)cell
866
- {
867
- TUICommonContactCellData *data = cell.contactData;
868
- // 创建好友资料 vc
869
- TUIFriendProfileController_Minimalist *vc = [[TUIFriendProfileController_Minimalist alloc] init];
870
- vc.friendProfile = data.friendProfile;
871
- // 展示好友资料 vc
872
- [self.navigationController pushViewController:(UIViewController *)vc animated:YES];
873
- }
874
- ```
272
+ ## AI 助手:知识咨询与代码集成
875
273
 
876
- ### 步骤6:接入智能客服 Desk 用户端(可选)
877
-
878
- 若需同时集成智能客服 Desk 用户端,请先 [开通智能客服 Desk 服务](https://cloud.tencent.com/document/product/269/96059),并根据 [iOS 接入智能客服用户端](https://cloud.tencent.com/document/product/269/110808) 文档完成 `TencentCloudAIDeskCustomer` 包引入和配置,即可在您的应用中引入客服会话能力。
879
- ``` objectivec
880
- #import <TencentCloudAIDeskCustomer/TencentCloudCustomerManager.h>
881
-
882
- int SDKAppID = 0; // 开通了智能客服 Desk 的应用 ID
883
- NSString *userID = @"";
884
- NSString *userSig = @"";
885
-
886
- // 上述三个参数, 可以和您登录腾讯云 IM 的保持一致, 也可以使用不同的应用和用户
887
-
888
- // 用户昵称。设置后,用户端转人工成功时,人工客服在工作台可见。您可将用户手机号,用户来源等信息写入昵称,长度限制500字节
889
- // 注意!设置后,即时通信 IM 同 userID 的昵称也会被更新
890
- // 如您不希望变更,请设置为 @"" 或 nil
891
- NSString *nickName = @"";
892
-
893
- // 用户头像。设置后,用户端转人工成功时,人工客服在工作台可见
894
- // 注意!设置后,即时通信 IM 同 userID 的头像也会被更新
895
- // 如您不希望变更,请设置为 @"" 或 nil
896
- NSString *avatar = @"";
897
-
898
- [[TencentCloudCustomerManager sharedManager]
899
- initWithProfile:SDKAppID
900
- userID:userID
901
- userSig:userSig
902
- nickName:nickName
903
- avatar:avatar
904
- completion:^(NSError *error) {
905
- if (error) {
906
- NSLog(@"login failed. error:%@", error);
907
- }
908
- }];
909
-
910
- // 点击打开智能客服会话页面
911
- [[TencentCloudCustomerManager sharedManager] pushCustomerServiceChatFromController:self];
912
- ```
913
-
914
- ### 步骤7:构建音视频通话功能
915
-
916
- TUI 组件支持在聊天界面对用户发起音视频通话,仅需要简单几步就可以快速集成:
917
-
918
- 1. 开通音视频服务。
919
-
920
- 2. 登录 即时通信 IM 控制台 ,单击目标应用卡片,进入应用的基础配置页面。
921
-
922
- 3. 在开通腾讯实时音视频服务功能区,单击**免费体验**即可开通 TUICallKit 的 7 天免费试用服务。
923
-
924
- 4. 在弹出的开通实时音视频 TRTC 服务对话框中,单击确认,系统将为您在 [实时音视频控制台](https://console.cloud.tencent.com/trtc) 创建一个与当前 IM 应用相同 SDKAppID 的实时音视频应用,二者账号与鉴权可复用。
925
-
926
- 5. 集成 TUICallKit 组件。
927
- 在 podfile 文件中添加以下内容。
928
-
929
- ``` objectivec
930
- // 集成音视频通话组件
931
- pod 'TUICallKit_Swift'
932
- ```
933
- 6. 使用音视频功能,需要授权摄像头和麦克风的使用权限,请根据实际项目需要,设置项目所需权限。
934
-
935
- 在 **Xcode** 中,选择 **TARGETS > Info > Custom iOS Target Properties** 菜单。
936
-
937
- 单击 **+**,添加摄像头和麦克风权限:
938
-
939
- - Privacy - Camera Usage Description
940
-
941
- - Privacy - Microphone Usage Description
942
-
943
- 7. 发起和接收视频或语音通话。
944
-
945
- 集成 TUICallKit 组件后,聊天界面和联系人资料界面默认会出现 “视频通话” 和 “语音通话” 两个按钮,当用户点击按钮时,TUIKit 会自动展示通话邀请 UI,并给对方发起通话邀请请求。
946
-
947
- - 当用户在线收到通话邀请时,TUIKit 会自动展示通话接收 UI,用户可以选择同意或者拒绝通话。
948
-
949
- - 当用户离线收到通话邀请时,如果需要唤起 App 通话,就要使用到离线推送能力,离线推送的实现请参见 [添加离线推送](https://cloud.tencent.com/document/product/269/109894)。
950
-
951
- 8. 添加离线推送。
952
- 在使用离线推送之前,您需要开通 [IM 离线推送](https://cloud.tencent.com/document/product/269/75429) 服务。
953
-
954
- 9. 关于 App 的配置,您可以参见文档:[集成推送服务(Push)跑通离线推送功能](https://cloud.tencent.com/document/product/269/109894)。
955
-
956
- > **说明:**
957
- >
958
- > 配置完成后,当单击接收到的**音视频通话离线推送通知**时, TUICallKit 会自动拉起**音视频通话邀请界面**。
959
- >
960
-
961
- 10. 附加增值能力
962
-
963
- 集成 TUIChat 和 TUICallKit 的组件后,在聊天界面发送语音消息时,即可**录制带 AI 降噪和自动增益的语音消息**。该功能需要购买 [音视频通话能力](https://cloud.tencent.com/document/product/1640/79968) 进阶版及以上套餐,仅 IMSDK 7.0 及以上版本支持。当套餐过期后,录制语音消息会切换到系统 API 进行录音。
964
-
965
- 下面是使用两台华为 P10 同时录制的语音消息对比:
966
-
967
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/portal/css/global-20209142343.css?max_age=31536000&amp;t=20191128" />
968
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/portal/css/global-components.css?max_age=31536000&amp;t=20180817" />
969
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/documentation/documentation-v4/css/pandect-20219091610.css" />
970
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/documentation/documentation-v4/css/import-2-markdown-20219091610.css" />
971
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/platform/documents/css/documents-202205161915.css" />
972
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/open_proj/proj_qcloud_v2/gateway/documentation/documentation-v4/css/pandect-202012171130.css" />
973
- <link rel="stylesheet" href="//qcloudimg.tencent-cloud.cn/static/document/qcloud-document-sdk.v0.0.17.css" />
974
- <link rel="stylesheet" href="//cloudcache.tencentcs.com/qcloud/main/components/document-feedback/document-feedback.944df9c907.css" />
975
- <style>
976
- * {
977
- font-family: 'pingfang SC','helvetica neue',arial,'hiragino sans gb','microsoft yahei ui','microsoft yahei',simsun,sans-serif;
978
- }
979
- </style>
980
-
981
- <div class="markdown-text-box">
982
- | <b>系统录制的语音消息<br></b> | <b>TUICallkit 录制的带 AI 降噪和自动增益的语音消息<br></b> |
983
- | --- | --- |
984
- | <audio id="audio" controls preload="none">
985
- <source id="m4a" src="https://im.sdk.cloudcachetci.com/tools/resource/rain_system_record.m4a"></source>
986
- </audio> | <audio id="audio" controls preload="none">
987
- <source id="m4a" src="https://im.sdk.cloudcachetci.com/tools/resource/rain_tuicallkit_record_with_agc_aidenoise.m4a"></source>
988
- </audio> |
989
-
990
- </div>
991
-
992
- ### 步骤8:构建多人音视频功能
993
-
994
- TUI 组件支持在聊天界面对用户发起多人音视频,仅需要简单几步就可以快速集成:
995
-
996
- 1. 开通音视频服务。
997
-
998
- 2. 登录 [即时通信 IM 控制台](https://console.cloud.tencent.com/im),单击目标应用卡片,进入应用的基础配置页面。
999
-
1000
- 3. 找到含 UI 低代码场景方案功能区,单击卡片下方的多人音视频(TUIRoomKit) > 免费体验。
1001
-
1002
- 4. 在弹窗中单击免费试用 7 天,即可成功开通多人音视频免费体验版。开通完成后即可参见 [集成指引](https://cloud.tencent.com/document/product/269/84296) 进行集成。
1003
-
1004
- 5. 集成 TUIRoomKit 组件。在 podfile 文件中添加以下内容。
1005
-
1006
- ``` ruby
1007
- // 集成多人音视频组件
1008
- pod 'TUIRoomKit'
1009
- ```
1010
- 6. 发起多人音视频会议
1011
-
1012
- 集成 TUIRoomKit 组件后,聊天界面默认会出现 “快速会议” 按钮,当用户点击按钮时,TUIKit 会自动发起会议,并在聊天记录中展示一条会议邀请卡片。
274
+ 在接入 IM SDK 过程中,您可以通过 MCP 使用 AI 助手,快速完成知识咨询、报错排查和 UIKit 集成代码生成。支持 Web/Android/iOS/Flutter/uni-app 等平台,答案基于官方文档。适用于查询 SDK API、UI 组件用法、服务端 API 与 IM 产品配置等场景,[立即体验,提出您的第一个问题](https://cloud.tencent.com/document/product/269/126983)。
1013
275
 
1014
276
  ## 常见问题
1015
277
 
1016
- #### 音视频常见问题
278
+ ### 音视频常见问题
1017
279
 
1018
- ##### 1. TUICallKit 和自己集成的音视频库冲突了?
280
+ #### TUICallKit 和自己集成的音视频库冲突了?
1019
281
 
1020
282
  腾讯云的音视频库不能同时集成,可能存在符号冲突,可以按照下面的场景处理。
1021
283
  1. 如果您使用了 `TXLiteAVSDK_TRTC` 库,不会发生符号冲突。可直接在 Podfile 文件中添加依赖,
@@ -1030,18 +292,34 @@ TUI 组件支持在聊天界面对用户发起多人音视频,仅需要简单
1030
292
  ```
1031
293
  3. 如果您使用了 `TXLiteAVSDK_Enterprise` 库,会产生符号冲突。建议升级到 `TXLiteAVSDK_Professional` 后使用 TUICallKit_Swift/Professional。
1032
294
 
1033
- ##### 2. 通话邀请的超时时间默认是多久?
295
+ #### 通话邀请的超时时间默认是多久?
1034
296
 
1035
297
  通话邀请的默认超时时间是 30 秒。
1036
298
 
1037
- ##### 3. 在邀请超时时间内,被邀请者如果离线再上线,能否立即收到邀请?
299
+ #### 在邀请超时时间内,被邀请者如果离线再上线,能否立即收到邀请?
1038
300
  - 如果是单聊通话邀请,被邀请者离线再上线可以收到通话邀请,TUIKit 内部会自动唤起通话邀请界面。
1039
301
 
1040
302
  - 如果是群聊通话邀请,被邀请者离线再上线后会自动拉取最近 30 秒内的邀请,TUIKit 会自动唤起群通话界面。
1041
303
 
1042
- #### 上架常见问题
304
+ #### 如何移除音视频通话功能?
305
+
306
+ ChatPage 默认集成了音视频通话功能,如果你不需要音视频通话功能。可以在 步骤 3 创建聊天界面 中关闭音视频通话开关,代码如下所示:
307
+
308
+ 【Swift】
309
+ ``` swift
310
+ func showChat(_ info: ConversationInfo) {
311
+ // 在输入配置中关闭输入面板中的视频通话和音频通话功能
312
+ let inputConfig = ChatMessageInputConfig(isShowVideoCall: false, isShowAudioCall: false)
313
+ let chatPage = ChatPage(conversation: info, messageInputConfig: inputConfig, onBack: { [weak self] in
314
+ self?.navigationController.popViewController(animated: true)
315
+ })
316
+ navigationController.pushViewController(chatPage, animated: true)
317
+ }
318
+ ```
1043
319
 
1044
- ##### 1. 上架 App Store 时打包失败,提示 Unsupported Architectures。
320
+ ### 上架常见问题
321
+
322
+ #### 上架 App Store 时打包失败,提示 Unsupported Architectures?
1045
323
 
1046
324
  您可以按照下面的步骤,在打包时去掉模拟器版本:
1047
325
  1. 选中您工程的 Target,并点击 Build Phases 选项,在当前面板中添加 Run Script;
@@ -1087,7 +365,7 @@ TUI 组件支持在聊天界面对用户发起多人音视频,仅需要简单
1087
365
 
1088
366
  ### Xcode 集成常见问题
1089
367
 
1090
- #### 1. [Xcodeproj] Unknown object version (60). (RuntimeError)
368
+ #### [Xcodeproj] Unknown object version (60). (RuntimeError)
1091
369
 
1092
370
  使用 Xcode 15 创建新工程来集成 TUIKit 时,输入 **pod install** 后,可能会遇到此问题,原因是使用了较旧版本的 CocoaPods ,此时有两种解决办法:
1093
371
 
@@ -1097,7 +375,7 @@ TUI 组件支持在聊天界面对用户发起多人音视频,仅需要简单
1097
375
 
1098
376
  您可以在终端输入 **pod --version** 查看当前的 Pods 版本。
1099
377
 
1100
- #### 2. -ld64链接器问题
378
+ #### -ld64链接器问题?
1101
379
 
1102
380
  Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp,
1103
381
 
@@ -1107,17 +385,17 @@ Assertion failed: (false && "compact unwind compressed function offset doesn't f
1107
385
 
1108
386
  在 **Build Settings** 中的 **Other Linker Flags** 中添加"**-ld64**",即可解决。 参考资料: [https://developer.apple.com/forums/thread/735426](https://links.jianshu.com/go)。
1109
387
 
1110
- #### 3. Rosetta 模拟器问题
388
+ #### Rosetta 模拟器问题?
1111
389
 
1112
390
  使用苹果芯片(M1\M2等系列芯片)时会遇到, 原因是包括 SDWebImage 在内的三方库,并未支持 xcframework,不过苹果依旧给出了适配办法,就是在模拟器上开启 Rosetta 设置, 一般情况下编译时会自动弹出 Rosetta 选项。
1113
391
 
1114
- #### 4. Xcode 15 开发者沙盒选项问题
392
+ #### Xcode 15 开发者沙盒选项问题?
1115
393
 
1116
394
  Sandbox: bash(xxx) deny(1) file-write-create
1117
395
 
1118
396
  当您使用 Xcode 15 创建一个新工程时, 可能会因为此选项导致编译运行失败,建议您关闭此选项。
1119
397
 
1120
- #### 5. Xcode 16 不支持 Framework 开启 bitcode 问题
398
+ #### Xcode 16 不支持 Framework 开启 bitcode 问题?
1121
399
 
1122
400
  **解决方案1:升级 SDK**
1123
401
 
@@ -1146,23 +424,13 @@ end
1146
424
 
1147
425
  ### CocoaPods 集成常见问题
1148
426
 
1149
- #### 1. 使用远端集成时,Pod 依赖版本不匹配问题
1150
-
1151
- 若您使用远端 Pods 集成时,出现 **Podfile.lock** 和 插件依赖的 TUICore 版本不一致时,
427
+ 若您执行 pod install,出现 **Podfile.lock** 和 插件依赖的版本不一致时,
1152
428
 
1153
429
  此时请删除 **Podfile.lock** 文件, 并使用 **pod repo update** 更新本地代码仓库, 之后使用 **pod update** 重新更新即可。
1154
430
 
1155
- #### 2. 使用本地集成时,Pod 依赖版本不匹配问题
1156
-
1157
- 若您使用 DevelopPods 集成时 出现 插件依赖的 **TUICore** 版本较新,但本地 Pod 依赖的版本号是 **1.0.0** ,
1158
-
1159
- 此时请您参见 [Podfile_local](https://github.com/TencentCloud/TIMSDK/blob/master/iOS/Demo/Podfile_local) 和 [TUICore.spec](https://github.com/TencentCloud/TIMSDK/blob/master/iOS/TUIKit/TUICore/TUICore.podspec) , 插件需要跟随版本,需要和 TUICore.spec 中一致,正常情况下我们会帮您修改为一致。
1160
-
1161
- 第一次使用本地集成时,建议您下载我们的示例 Demo 工程,将 Podfile 文件内容替换为 Podfile_local 的内容,执行 **Pod update** 后相互参照。
1162
-
1163
431
  ### 其他常见问题
1164
432
 
1165
- ##### 表情包的使用
433
+ #### 表情包的使用
1166
434
 
1167
435
  为了尊重版权,IM Demo/TUIKit 工程中默认不包含大表情元素切图。正式上线商用前请您替换为自己设计或拥有版权的其他表情包。下图所示默认的**小黄脸表情包版权归腾讯云所有**,可有偿授权使用,如需获得授权,您可以通过升级至 [IM 企业版套餐](https://buy.cloud.tencent.com/avc) 免费使用该表情包。
1168
436