@tencentcloud/sdk-mcp 1.3.4 → 1.3.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.
- package/package.json +1 -1
- package/resource/doc/chatuikit/android/features/theme.md +363 -0
- package/resource/doc/chatuikit/android/workflow.md +0 -0
- package/resource/doc/chatuikit/{android/client_api_android.md → faq/android_sdk/client-api.md} +0 -1
- package/resource/doc/chatuikit/faq/{native_sdk/faq.md → common/product.md} +8 -0
- package/resource/doc/chatuikit/faq/flutter_sdk/faq.md +54 -0
- package/resource/doc/chatuikit/faq/web_sdk/faq.md +1 -1
- package/resource/doc/chatuikit/flutter/features/theme.md +379 -0
- package/resource/doc/chatuikit/flutter/workflow.md +816 -0
- package/resource/doc/chatuikit/iOS/features/theme.md +416 -0
- package/resource/doc/chatuikit/iOS/workflow.md +0 -0
- package/resource/doc/chatuikit/react/components/chat-setting.md +124 -0
- package/resource/doc/chatuikit/react/components/contact-list.md +1331 -0
- package/resource/doc/chatuikit/react/components/search.md +885 -0
- package/resource/doc/chatuikit/vue/components/chat-setting.md +88 -0
- package/resource/doc/chatuikit/vue/components/contact-list.md +679 -0
- package/resource/doc/chatuikit/vue/components/search.md +1384 -0
- package/resource/doc/livekit/live/android/workflow.md +137 -4
- package/resource/doc/livekit/live/flutter/live-audience-list.md +337 -0
- package/resource/doc/livekit/live/flutter/live-audio-effect.md +739 -0
- package/resource/doc/livekit/live/flutter/live-barrage.md +578 -0
- package/resource/doc/livekit/live/flutter/live-base-beauty.md +484 -0
- package/resource/doc/livekit/live/flutter/live-co-guest-interaction.md +606 -0
- package/resource/doc/livekit/live/flutter/live-gift.md +812 -0
- package/resource/doc/livekit/live/flutter/live-host-interaction.md +1113 -0
- package/resource/doc/livekit/live/flutter/live-integration.md +1029 -0
- package/resource/doc/livekit/live/flutter/live-live-list.md +861 -0
- package/resource/doc/livekit/live/ios/live-audience-list.md +335 -0
- package/resource/doc/livekit/live/ios/live-audio-effect.md +373 -0
- package/resource/doc/livekit/live/ios/live-barrage.md +529 -0
- package/resource/doc/livekit/live/ios/live-base-beauty.md +237 -0
- package/resource/doc/livekit/live/ios/live-co-guest-interaction.md +483 -0
- package/resource/doc/livekit/live/ios/live-gift.md +785 -0
- package/resource/doc/livekit/live/ios/live-host-interaction.md +743 -0
- package/resource/doc/livekit/live/ios/live-integration.md +822 -0
- package/resource/doc/livekit/live/ios/live-live-list.md +535 -0
- package/resource/doc/livekit/live/ios/workflow.md +352 -0
- package/resource/doc/rtcengine/faq/web/web.md +2 -2
- package/resource/doc/rtcengine/web/how_to_integrated_web_sdk.md +2 -2
- package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +84 -0
- package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +86 -0
- package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +220 -0
- package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +217 -0
- package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +137 -0
- package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +97 -0
- package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +453 -0
- package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +180 -0
- package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +349 -0
- package/resource/doc/rtcengine/web/plugin/29-advanced-water-mark.md +149 -0
- package/resource/doc/rtcengine/web/plugin/30-advanced-cross-room-link.md +96 -0
- package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +405 -0
- package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +244 -0
- package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +84 -0
- package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +202 -0
- package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +98 -0
- package/resource/doc/rtcengine/web/plugin/38-advanced-basic-beauty.md +95 -0
- package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +33 -0
- package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +380 -0
- package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +91 -0
- package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +314 -0
- package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +180 -0
- package/tools/chat/get-native-chat-feature-detail.js +30 -0
- package/tools/chat/get-native-chat-feature-detail.js.map +1 -0
- package/tools/chat/get-native-chat-integration.js +30 -12
- package/tools/chat/get-native-chat-integration.js.map +1 -1
- package/tools/common/get-faq.js +2 -4
- package/tools/common/get-faq.js.map +1 -1
- package/tools/definitions/get_native_chat_feature_detail_def.js +32 -0
- package/tools/definitions/get_native_chat_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js +18 -6
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/{get_native_live_extra_features_def.js → get_native_live_uikit_extra_features_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +1 -0
- package/tools/definitions/{get_native_live_interaction_def.js → get_native_live_uikit_interaction_def.js} +3 -3
- package/tools/definitions/get_native_live_uikit_interaction_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +46 -7
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
- package/tools/index.js +6 -4
- package/tools/index.js.map +1 -1
- package/tools/live/{get_native_live_extra_features.js → get_native_live_uikit_extra_features.js} +4 -4
- package/tools/live/get_native_live_uikit_extra_features.js.map +1 -0
- package/tools/live/{get_native_live_interaction.js → get_native_live_uikit_interaction.js} +4 -4
- package/tools/live/get_native_live_uikit_interaction.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-faq.js +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js +45 -0
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +1 -0
- package/utils/handle-component-name.js +0 -16
- package/utils/handle-component-name.js.map +1 -1
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/chatuikit/android/integrate_tuichat_only_android.md +0 -382
- package/resource/doc/chatuikit/android/ui_api_android.md +0 -418
- package/resource/doc/chatuikit/iOS/integrate_tuichat_only_iOS.md +0 -993
- package/resource/doc/chatuikit/iOS/ui_api_iOS.md +0 -526
- package/tools/definitions/get_native_live_extra_features_def.js.map +0 -1
- package/tools/definitions/get_native_live_interaction_def.js.map +0 -1
- package/tools/live/get_native_live_extra_features.js.map +0 -1
- package/tools/live/get_native_live_interaction.js.map +0 -1
- /package/resource/doc/chatuikit/android/{integrate_tuikit_android.md → integration.md} +0 -0
- /package/resource/doc/chatuikit/{flutter/client_api_Flutter.md → faq/flutter_sdk/client-api.md} +0 -0
- /package/resource/doc/chatuikit/{iOS/client_api_iOS.md → faq/ios_sdk/client-api.md} +0 -0
- /package/resource/doc/chatuikit/flutter/{integrate_tuikit_Flutter.md → integration.md} +0 -0
- /package/resource/doc/chatuikit/iOS/{integrate_tuikit_iOS.md → integration.md} +0 -0
- /package/resource/doc/chatuikit/react/components/{chatheader.md → chat-header.md} +0 -0
- /package/resource/doc/chatuikit/vue/components/{chatheader.md → chat-header.md} +0 -0
|
@@ -1,993 +0,0 @@
|
|
|
1
|
-
## 适用场景
|
|
2
|
-
|
|
3
|
-
TUIChat 提供了私信聊天(1V1)和群聊(Group)功能,支持对消息的多种操作,例如发送不同类型的消息、对消息长按点赞/回复/引用、查询消息已读回执详情等。
|
|
4
|
-
|
|
5
|
-
您可以仅集成 TUIChat 到您的 App 中。聊天界面使用场景非常广泛,例如房产中介咨询、在线医疗问诊、电商在线客服、保险远程定损等。
|
|
6
|
-
界面效果如下图所示:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
【经典版】
|
|
11
|
-
<table>
|
|
12
|
-
<tr>
|
|
13
|
-
<td rowspan="1" colSpan="1" >消息界面</td>
|
|
14
|
-
|
|
15
|
-
<td rowspan="1" colSpan="1" >发送多种类型消息</td>
|
|
16
|
-
</tr>
|
|
17
|
-
|
|
18
|
-
<tr>
|
|
19
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
20
|
-
|
|
21
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
22
|
-
</tr>
|
|
23
|
-
</table>
|
|
24
|
-
|
|
25
|
-
<table>
|
|
26
|
-
<tr>
|
|
27
|
-
<td rowspan="1" colSpan="1" >消息点赞/回复/引用</td>
|
|
28
|
-
|
|
29
|
-
<td rowspan="1" colSpan="1" >消息回复详情</td>
|
|
30
|
-
</tr>
|
|
31
|
-
|
|
32
|
-
<tr>
|
|
33
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
34
|
-
|
|
35
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
36
|
-
</tr>
|
|
37
|
-
</table>
|
|
38
|
-
|
|
39
|
-
<table>
|
|
40
|
-
<tr>
|
|
41
|
-
<td rowspan="1" colSpan="1" >消息已读回执</td>
|
|
42
|
-
|
|
43
|
-
<td rowspan="1" colSpan="1" >已读回执详情</td>
|
|
44
|
-
</tr>
|
|
45
|
-
|
|
46
|
-
<tr>
|
|
47
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
48
|
-
|
|
49
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
50
|
-
</tr>
|
|
51
|
-
</table>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
【简约版】
|
|
55
|
-
<table>
|
|
56
|
-
<tr>
|
|
57
|
-
<td rowspan="1" colSpan="1" >消息界面 \| 发送多种类型消息</td>
|
|
58
|
-
</tr>
|
|
59
|
-
|
|
60
|
-
<tr>
|
|
61
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
62
|
-
</tr>
|
|
63
|
-
</table>
|
|
64
|
-
|
|
65
|
-
<table>
|
|
66
|
-
<tr>
|
|
67
|
-
<td rowspan="1" colSpan="1" >消息点赞 \| 回复 </td>
|
|
68
|
-
</tr>
|
|
69
|
-
|
|
70
|
-
<tr>
|
|
71
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
72
|
-
</tr>
|
|
73
|
-
</table>
|
|
74
|
-
|
|
75
|
-
<table>
|
|
76
|
-
<tr>
|
|
77
|
-
<td rowspan="1" colSpan="1" >消息已读回执 \| 已读回执详情</td>
|
|
78
|
-
</tr>
|
|
79
|
-
|
|
80
|
-
<tr>
|
|
81
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
82
|
-
</tr>
|
|
83
|
-
</table>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
【RTL 语言】
|
|
87
|
-
<table>
|
|
88
|
-
<tr>
|
|
89
|
-
<td rowspan="1" colSpan="1" >消息界面 \| 发送多种类型消息</td>
|
|
90
|
-
</tr>
|
|
91
|
-
|
|
92
|
-
<tr>
|
|
93
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
94
|
-
</tr>
|
|
95
|
-
</table>
|
|
96
|
-
|
|
97
|
-
<table>
|
|
98
|
-
<tr>
|
|
99
|
-
<td rowspan="1" colSpan="1" >消息点赞 \| 回复 </td>
|
|
100
|
-
</tr>
|
|
101
|
-
|
|
102
|
-
<tr>
|
|
103
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
104
|
-
</tr>
|
|
105
|
-
</table>
|
|
106
|
-
|
|
107
|
-
<table>
|
|
108
|
-
<tr>
|
|
109
|
-
<td rowspan="1" colSpan="1" >消息已读回执 \| 已读回执详情</td>
|
|
110
|
-
</tr>
|
|
111
|
-
|
|
112
|
-
<tr>
|
|
113
|
-
<td rowspan="1" colSpan="1" ></td>
|
|
114
|
-
</tr>
|
|
115
|
-
</table>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
## 开发环境要求
|
|
119
|
-
- Xcode 10 及以上
|
|
120
|
-
|
|
121
|
-
- iOS 9.0 及以上
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
## 通过 Pod 集成 TUIChat 源码
|
|
125
|
-
|
|
126
|
-
我们为您提供了两种 Podfile 集成方式:拉取远程 CocoaPods 集成(方式一)和 Development Pods 本地集成(方式二),这两种方式的优劣如下:
|
|
127
|
-
- 拉取远程 CocoaPods 集成(方式一) 适合无源码修改时的集成:
|
|
128
|
-
|
|
129
|
-
- 优点: 当 TUIChat 有版本更新时您只需再次 Pod update 即可完成更新。
|
|
130
|
-
|
|
131
|
-
- 缺点: 当您有源码修改时,使用 Pod update 更新时,新版本的 TUIChat 会覆盖您的修改。
|
|
132
|
-
|
|
133
|
-
- Development Pods 本地集成(方式二) 适合有涉及源码自定义修改的客户:
|
|
134
|
-
|
|
135
|
-
- 优点: 当您有自己的 git 仓库时,可以跟踪修改,并且修改源码后,使用 Pod update 更新(其他非本地集成 Pod)时,不会覆盖您的修改。
|
|
136
|
-
|
|
137
|
-
- 缺点: 您需要手动从 TUIChat 源码([Swift](https://github.com/Tencent-RTC/Chat_UIKit/tree/main/Swift/TUIKit/TUIChat) | [Objective-C](https://github.com/TencentCloud/TIMSDK/tree/master/iOS/TUIKit/TUIChat)) 覆盖您本地 TUIChat 文件夹进行更新。
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### 方式一:拉取远程 CocoaPods 集成(无源码修改时推荐)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
【经典版】
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
【Swift】
|
|
150
|
-
``` bash
|
|
151
|
-
# Uncomment the next line to define a global platform for your project
|
|
152
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
153
|
-
platform :ios, '13.0'
|
|
154
|
-
# 防止 TUIChat 组件里的 *.xcassets 与您项目里面冲突。
|
|
155
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
156
|
-
|
|
157
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
158
|
-
target 'your_project_name' do
|
|
159
|
-
use_frameworks!
|
|
160
|
-
use_modular_headers!
|
|
161
|
-
|
|
162
|
-
# 集成聊天功能
|
|
163
|
-
pod 'TUIChat_Swift/UI_Classic'
|
|
164
|
-
end
|
|
165
|
-
|
|
166
|
-
#Pods config
|
|
167
|
-
post_install do |installer|
|
|
168
|
-
installer.pods_project.targets.each do |target|
|
|
169
|
-
target.build_configurations.each do |config|
|
|
170
|
-
#Fix Xcode14 Bundle target error
|
|
171
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
172
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
173
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
174
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
175
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
176
|
-
#Fix Xcode15 other links flag -ld64
|
|
177
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
178
|
-
if xcode_version >= 15
|
|
179
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
180
|
-
xcconfig = File.read(xcconfig_path)
|
|
181
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
182
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
183
|
-
else
|
|
184
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
185
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
186
|
-
end
|
|
187
|
-
if xcconfig.include?("-ld64") == false
|
|
188
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
【Objective-C】
|
|
200
|
-
``` bash
|
|
201
|
-
# Uncomment the next line to define a global platform for your project
|
|
202
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
203
|
-
platform :ios, '13.0'
|
|
204
|
-
# 防止 TUIChat 组件里的 *.xcassets 与您项目里面冲突。
|
|
205
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
206
|
-
|
|
207
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
208
|
-
target 'your_project_name' do
|
|
209
|
-
use_frameworks!
|
|
210
|
-
|
|
211
|
-
# 开启 modular headers。请按需开启,开启后 Pod 模块才能使用 @import 导入。
|
|
212
|
-
# use_modular_headers!
|
|
213
|
-
|
|
214
|
-
# 集成聊天功能
|
|
215
|
-
pod 'TUIChat/UI_Classic'
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
#Pods config
|
|
219
|
-
post_install do |installer|
|
|
220
|
-
installer.pods_project.targets.each do |target|
|
|
221
|
-
target.build_configurations.each do |config|
|
|
222
|
-
#Fix Xcode14 Bundle target error
|
|
223
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
224
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
225
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
226
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
227
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
228
|
-
#Fix Xcode15 other links flag -ld64
|
|
229
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
230
|
-
if xcode_version >= 15
|
|
231
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
232
|
-
xcconfig = File.read(xcconfig_path)
|
|
233
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
234
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
235
|
-
else
|
|
236
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
237
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
238
|
-
end
|
|
239
|
-
if xcconfig.include?("-ld64") == false
|
|
240
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
241
|
-
end
|
|
242
|
-
end
|
|
243
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
244
|
-
end
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
【简约版】
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
【Swift】
|
|
256
|
-
``` bash
|
|
257
|
-
# Uncomment the next line to define a global platform for your project
|
|
258
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
259
|
-
platform :ios, '13.0'
|
|
260
|
-
# 防止 TUIChat 组件里的 *.xcassets 与您项目里面冲突。
|
|
261
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
262
|
-
|
|
263
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
264
|
-
target 'your_project_name' do
|
|
265
|
-
use_frameworks!
|
|
266
|
-
use_modular_headers!
|
|
267
|
-
|
|
268
|
-
# 集成聊天功能
|
|
269
|
-
pod 'TUIChat_Swift/UI_Minimalist'
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
#Pods config
|
|
273
|
-
post_install do |installer|
|
|
274
|
-
installer.pods_project.targets.each do |target|
|
|
275
|
-
target.build_configurations.each do |config|
|
|
276
|
-
#Fix Xcode14 Bundle target error
|
|
277
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
278
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
279
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
280
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
281
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
282
|
-
#Fix Xcode15 other links flag -ld64
|
|
283
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
284
|
-
if xcode_version >= 15
|
|
285
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
286
|
-
xcconfig = File.read(xcconfig_path)
|
|
287
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
288
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
289
|
-
else
|
|
290
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
291
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
292
|
-
end
|
|
293
|
-
if xcconfig.include?("-ld64") == false
|
|
294
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
298
|
-
end
|
|
299
|
-
end
|
|
300
|
-
end
|
|
301
|
-
end
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
【Objective-C】
|
|
306
|
-
``` bash
|
|
307
|
-
# Uncomment the next line to define a global platform for your project
|
|
308
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
309
|
-
platform :ios, '13.0'
|
|
310
|
-
# 防止 TUIChat 组件里的 *.xcassets 与您项目里面冲突。
|
|
311
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
312
|
-
|
|
313
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
314
|
-
target 'your_project_name' do
|
|
315
|
-
use_frameworks!
|
|
316
|
-
|
|
317
|
-
# 开启 modular headers。请按需开启,开启后 Pod 模块才能使用 @import 导入。
|
|
318
|
-
# use_modular_headers!
|
|
319
|
-
|
|
320
|
-
# 集成聊天功能
|
|
321
|
-
pod 'TUIChat/UI_Minimalist'
|
|
322
|
-
end
|
|
323
|
-
|
|
324
|
-
#Pods config
|
|
325
|
-
post_install do |installer|
|
|
326
|
-
installer.pods_project.targets.each do |target|
|
|
327
|
-
target.build_configurations.each do |config|
|
|
328
|
-
#Fix Xcode14 Bundle target error
|
|
329
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
330
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
331
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
332
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
333
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
334
|
-
#Fix Xcode15 other links flag -ld64
|
|
335
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
336
|
-
if xcode_version >= 15
|
|
337
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
338
|
-
xcconfig = File.read(xcconfig_path)
|
|
339
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
340
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
341
|
-
else
|
|
342
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
343
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
344
|
-
end
|
|
345
|
-
if xcconfig.include?("-ld64") == false
|
|
346
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
347
|
-
end
|
|
348
|
-
end
|
|
349
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
350
|
-
end
|
|
351
|
-
end
|
|
352
|
-
end
|
|
353
|
-
end
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
> **说明:**
|
|
357
|
-
>
|
|
358
|
-
> - 如果您直接 `pod 'TUIChat'`,不指定经典版或简约版,默认会集成两套版本 UI 组件。
|
|
359
|
-
> - 如果您使用的是 Swift,请开启 `use_modular_headers!` ,并将头文件引用改成 @import 模块名形式引用。
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
执行以下命令,安装 TUIChat 组件。
|
|
363
|
-
``` bash
|
|
364
|
-
pod install
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
如果无法安装 TUIChat 最新版本,执行以下命令更新本地的 CocoaPods 仓库列表。
|
|
368
|
-
``` bash
|
|
369
|
-
pod repo update
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
之后执行以下命令,更新组件库的 Pod 版本。
|
|
373
|
-
``` bash
|
|
374
|
-
pod update
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
集成 TUIChat 组件后的项目结构:
|
|
378
|
-
|
|
379
|
-

|
|
380
|
-
|
|
381
|
-
> **注意:**
|
|
382
|
-
>
|
|
383
|
-
|
|
384
|
-
> 若您操作遇到错误,可查阅文末的常见问题。
|
|
385
|
-
>
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
### 方式二:Development Pods 本地集成(有源码修改时推荐)
|
|
389
|
-
1. 从 GitHub 下载 TUIChat 源码。直接拖入您的工程目录下,如:`TestTUIKitIM/TUIKit/TUIChat`。
|
|
390
|
-
|
|
391
|
-
- [Swift TUIKit 源码 Github 地址](https://github.com/Tencent-RTC/Chat_UIKit/tree/main/Swift/TUIKit):
|
|
392
|
-
|
|
393
|
-

|
|
394
|
-
|
|
395
|
-
- [Objective-C TUIKit 源码 Github 地址](https://github.com/TencentCloud/TIMSDK/tree/master/iOS/TUIKit):
|
|
396
|
-
|
|
397
|
-

|
|
398
|
-
|
|
399
|
-
2. 修改您 Podfile 中每个组件的本地路径, 路径修改为 TUIChat 文件夹相对您工程 Podfile 文件的路径。
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
例如 Demo 中的 pod 'TUIChat', :path => "./TUIKit/TUIChat"
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
> **说明: **
|
|
406
|
-
>
|
|
407
|
-
|
|
408
|
-
> 上例中的 TUIChat 文件夹位于 TUIKit 的子目录,此时我们使用 pod 'TUIChat', :path => "./TUIKit/TUIChat"
|
|
409
|
-
>
|
|
410
|
-
|
|
411
|
-
> 其他相对路径的表示如下:
|
|
412
|
-
>
|
|
413
|
-
> - 父目录: pod 'TUIChat', :path => "../TUIKit/TUIChat"
|
|
414
|
-
> - 当前目录: pod 'TUIChat', :path => "/TUIKit/TUIChat"
|
|
415
|
-
> - 子目录: pod 'TUIChat', :path => "./TUIKit/TUIChat"
|
|
416
|
-
|
|
417
|
-
3. 修改完成后 `pod update`
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
【Development Podfile】
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
【Swift】
|
|
428
|
-
``` bash
|
|
429
|
-
# Uncomment the next line to define a global platform for your project
|
|
430
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
431
|
-
platform :ios, '13.0'
|
|
432
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
433
|
-
|
|
434
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
435
|
-
target 'your_project_name' do
|
|
436
|
-
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
|
|
437
|
-
use_frameworks!
|
|
438
|
-
use_modular_headers!
|
|
439
|
-
|
|
440
|
-
# 集成基础库(必选)
|
|
441
|
-
pod 'TUICore', :path => "../TUIKit/TUICore"
|
|
442
|
-
pod 'TIMCommon_Swift', :path => "../TUIKit/TIMCommon"
|
|
443
|
-
|
|
444
|
-
# 集成聊天功能
|
|
445
|
-
pod 'TUIChat_Swift', :path => "../TUIKit/TUIChat"
|
|
446
|
-
|
|
447
|
-
# 其他 Pod
|
|
448
|
-
pod 'MJRefresh'
|
|
449
|
-
pod 'SnapKit'
|
|
450
|
-
end
|
|
451
|
-
|
|
452
|
-
#Pods config
|
|
453
|
-
post_install do |installer|
|
|
454
|
-
installer.pods_project.targets.each do |target|
|
|
455
|
-
target.build_configurations.each do |config|
|
|
456
|
-
#Fix Xcode14 Bundle target error
|
|
457
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
458
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
459
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
460
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
461
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
462
|
-
#Fix Xcode15 other links flag -ld64
|
|
463
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
464
|
-
if xcode_version >= 15
|
|
465
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
466
|
-
xcconfig = File.read(xcconfig_path)
|
|
467
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
468
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
469
|
-
else
|
|
470
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
471
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
472
|
-
end
|
|
473
|
-
if xcconfig.include?("-ld64") == false
|
|
474
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
475
|
-
end
|
|
476
|
-
end
|
|
477
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
478
|
-
end
|
|
479
|
-
end
|
|
480
|
-
end
|
|
481
|
-
end
|
|
482
|
-
```
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
【Objective-C】
|
|
486
|
-
``` bash
|
|
487
|
-
# Uncomment the next line to define a global platform for your project
|
|
488
|
-
source 'https://github.com/CocoaPods/Specs.git'
|
|
489
|
-
platform :ios, '13.0'
|
|
490
|
-
install! 'cocoapods', :disable_input_output_paths => true
|
|
491
|
-
|
|
492
|
-
# 请使用您的真实项目名称替换 your_project_name
|
|
493
|
-
target 'your_project_name' do
|
|
494
|
-
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
|
|
495
|
-
use_frameworks!
|
|
496
|
-
use_modular_headers!
|
|
497
|
-
|
|
498
|
-
# 注意:使用本地集成方案时,如需升级时需要从 https://github.com/TencentCloud/TIMSDK/tree/master/iOS/TUIKit/TUIChat
|
|
499
|
-
# 获取最新的组件代码,放置在本地指定目录下,如/TIMSDK/ios/TUIKit/TUIChat
|
|
500
|
-
# 注意:当私有化修改和远端有冲突时,需要手动合并,处理冲突。
|
|
501
|
-
|
|
502
|
-
# 集成基础库(必选)
|
|
503
|
-
pod 'TUICore', :path => "../TUIKit/TUICore"
|
|
504
|
-
pod 'TIMCommon', :path => "../TUIKit/TIMCommon"
|
|
505
|
-
|
|
506
|
-
# 集成聊天功能
|
|
507
|
-
pod 'TUIChat', :path => "../TUIKit/TUIChat"
|
|
508
|
-
|
|
509
|
-
# 其他 Pod
|
|
510
|
-
pod 'MJRefresh'
|
|
511
|
-
pod 'Masonry'
|
|
512
|
-
end
|
|
513
|
-
|
|
514
|
-
#Pods config
|
|
515
|
-
post_install do |installer|
|
|
516
|
-
installer.pods_project.targets.each do |target|
|
|
517
|
-
target.build_configurations.each do |config|
|
|
518
|
-
#Fix Xcode14 Bundle target error
|
|
519
|
-
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
|
|
520
|
-
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
|
|
521
|
-
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
|
|
522
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
523
|
-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
|
|
524
|
-
#Fix Xcode15 other links flag -ld64
|
|
525
|
-
xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
|
|
526
|
-
if xcode_version >= 15
|
|
527
|
-
xcconfig_path = config.base_configuration_reference.real_path
|
|
528
|
-
xcconfig = File.read(xcconfig_path)
|
|
529
|
-
if xcconfig.include?("OTHER_LDFLAGS") == false
|
|
530
|
-
xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
|
|
531
|
-
else
|
|
532
|
-
if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
|
|
533
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
|
|
534
|
-
end
|
|
535
|
-
if xcconfig.include?("-ld64") == false
|
|
536
|
-
xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
|
|
537
|
-
end
|
|
538
|
-
end
|
|
539
|
-
File.open(xcconfig_path, "w") { |file| file << xcconfig }
|
|
540
|
-
end
|
|
541
|
-
end
|
|
542
|
-
end
|
|
543
|
-
end
|
|
544
|
-
```
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
> **注意:**
|
|
548
|
-
>
|
|
549
|
-
> - 使用本地集成方案时,如需升级时可更新 Github 源码升级。
|
|
550
|
-
> - 获取最新的组件代码,覆盖本地目录如:TIMSDK/iOS/TUIKit/TUIChat。
|
|
551
|
-
> - 当私有化修改和远端有冲突时,需要手动合并,处理冲突。
|
|
552
|
-
> - TUIChat 插件需要依赖 TUICore 的版本,务必确保插件版本和 "../TUIKit/TUICore/TUICore.spec"中的 spec.version 一致。
|
|
553
|
-
> - 若您操作遇到错误,可查阅文末的常见问题。
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
## 组件登录
|
|
557
|
-
|
|
558
|
-
TUIChat 组件登录成功之后才能正常使用聊天功能。
|
|
559
|
-
|
|
560
|
-
其中,SDKAppID 需要在 [即时通信 IM 控制台](https://console.cloud.tencent.com/im) 创建并获取,userSig 需要按规则计算,详细步骤请参考文档 [跑通 Demo](https://cloud.tencent.com/document/product/269/68228#.E6.93.8D.E4.BD.9C.E6.AD.A5.E9.AA.A4)。
|
|
561
|
-
|
|
562
|
-
示例代码如下所示:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
【Swift】
|
|
568
|
-
``` swift
|
|
569
|
-
@objc func loginSDK(_ userID: String, userSig: String, succ: TSucc?, fail: TFail?) {
|
|
570
|
-
TUILogin.login(Int32(SDKAPPID), userID: userID, userSig: userSig, config: loginConfig, succ: {
|
|
571
|
-
// update UI
|
|
572
|
-
succ?()
|
|
573
|
-
}, fail: { code, msg in
|
|
574
|
-
// update UI
|
|
575
|
-
fail?(code, msg)
|
|
576
|
-
})
|
|
577
|
-
}
|
|
578
|
-
```
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
【Objective-C】
|
|
582
|
-
``` objectivec
|
|
583
|
-
#import "TUILogin.h"
|
|
584
|
-
|
|
585
|
-
- (void)loginSDK:(NSString *)userID userSig:(NSString *)sig succ:(TSucc)succ fail:(TFail)fail {
|
|
586
|
-
[TUILogin login:SDKAppID userID:userID userSig:sig succ:^{
|
|
587
|
-
NSLog(@"登录成功");
|
|
588
|
-
} fail:^(int code, NSString *msg) {
|
|
589
|
-
NSLog(@"登录失败");
|
|
590
|
-
}];
|
|
591
|
-
}
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
## 跳转到聊天界面
|
|
595
|
-
|
|
596
|
-
您可以直接从您的 App 界面,跳转到 TUIChat 聊天界面。初始化聊天界面时,需要上层传入当前聊天界面对应的会话信息。
|
|
597
|
-
|
|
598
|
-
示例代码如下所示:
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
【经典版】
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
【Swift】
|
|
608
|
-
``` swift
|
|
609
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
610
|
-
func pushToChatViewController(groupID: String?, userID: String?) {
|
|
611
|
-
// 创建会话信息
|
|
612
|
-
let conversationData = TUIChatConversationModel()
|
|
613
|
-
conversationData.userID = userID
|
|
614
|
-
conversationData.groupID = groupID
|
|
615
|
-
|
|
616
|
-
// 创建 chatVC
|
|
617
|
-
var chatVC: TUIBaseChatViewController?
|
|
618
|
-
|
|
619
|
-
if let userID = conversationData.userID, !userID.isEmpty {
|
|
620
|
-
chatVC = TUIC2CChatViewController()
|
|
621
|
-
} else if let groupID = conversationData.groupID, !groupID.isEmpty {
|
|
622
|
-
chatVC = TUIGroupChatViewController()
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
chatVC?.conversationData = conversationData
|
|
626
|
-
|
|
627
|
-
navigationController?.pushViewController(chatVC!, animated: true)
|
|
628
|
-
}
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
【Objective-C】
|
|
633
|
-
``` objectivec
|
|
634
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
635
|
-
- (void)pushToChatViewController:(NSString *)groupID userID:(NSString *)userID {
|
|
636
|
-
// 创建会话信息
|
|
637
|
-
TUIChatConversationModel *conversationData = [[TUIChatConversationModel alloc] init];
|
|
638
|
-
conversationData.userID = userID;
|
|
639
|
-
conversationData.groupID = groupID;
|
|
640
|
-
|
|
641
|
-
// 创建 chatVC
|
|
642
|
-
TUIBaseChatViewController *chatVC = nil;
|
|
643
|
-
if (conversationData.userID.length > 0) {
|
|
644
|
-
chatVC = [[TUIC2CChatViewController alloc] init];
|
|
645
|
-
} else if (conversationData.groupID.length > 0) {
|
|
646
|
-
chatVC = [[TUIGroupChatViewController alloc] init];
|
|
647
|
-
}
|
|
648
|
-
chatVC.conversationData = conversationData;
|
|
649
|
-
|
|
650
|
-
[self.navigationController pushViewController:chatVC animated:YES];
|
|
651
|
-
}
|
|
652
|
-
```
|
|
653
|
-
|
|
654
|
-
【简约版】
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
【Swift】
|
|
660
|
-
``` swift
|
|
661
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
662
|
-
func pushToChatViewController(groupID: String?, userID: String?) {
|
|
663
|
-
// 创建会话信息
|
|
664
|
-
let conversationData = TUIChatConversationModel()
|
|
665
|
-
conversationData.userID = userID
|
|
666
|
-
conversationData.groupID = groupID
|
|
667
|
-
|
|
668
|
-
// 创建 chatVC
|
|
669
|
-
var chatVC: TUIBaseChatViewController_Minimalist?
|
|
670
|
-
|
|
671
|
-
if let userID = conversationData.userID, !userID.isEmpty {
|
|
672
|
-
chatVC = TUIC2CChatViewController_Minimalist()
|
|
673
|
-
} else if let groupID = conversationData.groupID, !groupID.isEmpty {
|
|
674
|
-
chatVC = TUIGroupChatViewController_Minimalist()
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
chatVC?.conversationData = conversationData
|
|
678
|
-
|
|
679
|
-
navigationController?.pushViewController(chatVC!, animated: true)
|
|
680
|
-
}
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
【Objective-C】
|
|
685
|
-
``` objectivec
|
|
686
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
687
|
-
- (void)pushToChatViewController:(NSString *)groupID userID:(NSString *)userID {
|
|
688
|
-
// 创建会话信息
|
|
689
|
-
TUIChatConversationModel *conversationData = [[TUIChatConversationModel alloc] init];
|
|
690
|
-
conversationData.userID = userID;
|
|
691
|
-
conversationData.groupID = groupID;
|
|
692
|
-
|
|
693
|
-
// 创建 chatVC
|
|
694
|
-
TUIBaseChatViewController_Minimalist *chatVC = nil;
|
|
695
|
-
if (conversationData.userID.length > 0) {
|
|
696
|
-
chatVC = [[TUIC2CChatViewController_Minimalist alloc] init];
|
|
697
|
-
} else if (conversationData.groupID.length > 0) {
|
|
698
|
-
chatVC = [[TUIGroupChatViewController_Minimalist alloc] init];
|
|
699
|
-
}
|
|
700
|
-
chatVC.conversationData = conversationData;
|
|
701
|
-
|
|
702
|
-
[self.navigationController pushViewController:chatVC animated:YES];
|
|
703
|
-
}
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
## 集成聊天窗口到自己的页面中
|
|
709
|
-
|
|
710
|
-
您也可以将 TUIChat 聊天界面,嵌入到自己控制器的 View 中。
|
|
711
|
-
|
|
712
|
-
示例代码如下所示:
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
【经典版】
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
【Swift】
|
|
722
|
-
``` swift
|
|
723
|
-
class ChatViewController: UIViewController {
|
|
724
|
-
override func viewDidLoad() {
|
|
725
|
-
super.viewDidLoad()
|
|
726
|
-
|
|
727
|
-
// 创建会话信息
|
|
728
|
-
let conversationData = TUIChatConversationModel()
|
|
729
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
730
|
-
conversationData.userID = "userID"
|
|
731
|
-
conversationData.groupID = "groupID"
|
|
732
|
-
|
|
733
|
-
// 创建 chatVC
|
|
734
|
-
var chatVC: TUIBaseChatViewController?
|
|
735
|
-
|
|
736
|
-
if let groupID = conversationData.groupID, !groupID.isEmpty {
|
|
737
|
-
chatVC = TUIGroupChatViewController()
|
|
738
|
-
} else if let userID = conversationData.userID, !userID.isEmpty {
|
|
739
|
-
chatVC = TUIC2CChatViewController()
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
chatVC?.setConversationData(conversationData)
|
|
743
|
-
|
|
744
|
-
// 把 chatVC 添加到自己的 ViewController 上
|
|
745
|
-
if let vc = chatVC {
|
|
746
|
-
addChild(vc)
|
|
747
|
-
view.addSubview(vc.view)
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
【Objective-C】
|
|
755
|
-
``` objectivec
|
|
756
|
-
#import "TUIC2CChatViewController.h"
|
|
757
|
-
#import "TUIGroupChatViewController.h"
|
|
758
|
-
|
|
759
|
-
// ChatViewController 为您自己的 ViewController
|
|
760
|
-
@implementation ChatViewController
|
|
761
|
-
- (void)viewDidLoad {
|
|
762
|
-
// 创建会话信息
|
|
763
|
-
TUIChatConversationModel *conversationData = [[TUIChatConversationModel alloc] init];
|
|
764
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
765
|
-
conversationData.userID = @"userID";
|
|
766
|
-
conversationData.groupID = @"groupID";
|
|
767
|
-
|
|
768
|
-
// 创建 chatVC
|
|
769
|
-
TUIBaseChatViewController *chatVC = nil;
|
|
770
|
-
if (conversationData.groupID.length > 0) {
|
|
771
|
-
chatVC = [[TUIGroupChatViewController alloc] init];
|
|
772
|
-
} else if (conversationData.userID.length > 0) {
|
|
773
|
-
chatVC = [[TUIC2CChatViewController alloc] init];
|
|
774
|
-
}
|
|
775
|
-
[chatVC setConversationData:conversationData];
|
|
776
|
-
|
|
777
|
-
// 把 chatVC 添加到自己的 ViewController 上
|
|
778
|
-
[self addChildViewController:vc];
|
|
779
|
-
[self.view addSubview:vc.view];
|
|
780
|
-
}
|
|
781
|
-
@end
|
|
782
|
-
```
|
|
783
|
-
|
|
784
|
-
【简约版】
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
【Swift】
|
|
790
|
-
``` swift
|
|
791
|
-
class ChatViewController: UIViewController {
|
|
792
|
-
override func viewDidLoad() {
|
|
793
|
-
super.viewDidLoad()
|
|
794
|
-
|
|
795
|
-
// 创建会话信息
|
|
796
|
-
let conversationData = TUIChatConversationModel()
|
|
797
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
798
|
-
conversationData.userID = "userID"
|
|
799
|
-
conversationData.groupID = "groupID"
|
|
800
|
-
|
|
801
|
-
// 创建 chatVC
|
|
802
|
-
var chatVC: TUIBaseChatViewController_Minimalist?
|
|
803
|
-
|
|
804
|
-
if let groupID = conversationData.groupID, !groupID.isEmpty {
|
|
805
|
-
chatVC = TUIGroupChatViewController_Minimalist()
|
|
806
|
-
} else if let userID = conversationData.userID, !userID.isEmpty {
|
|
807
|
-
chatVC = TUIC2CChatViewController_Minimalist()
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
chatVC?.setConversationData(conversationData)
|
|
811
|
-
|
|
812
|
-
// 把 chatVC 添加到自己的 ViewController 上
|
|
813
|
-
if let vc = chatVC {
|
|
814
|
-
addChild(vc)
|
|
815
|
-
view.addSubview(vc.view)
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
```
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
【Objective-C】
|
|
823
|
-
``` objectivec
|
|
824
|
-
#import "TUIC2CChatViewController_Minimalist.h"
|
|
825
|
-
#import "TUIGroupChatViewController_Minimalist.h"
|
|
826
|
-
|
|
827
|
-
// ChatViewController 为您自己的 ViewController
|
|
828
|
-
@implementation ChatViewController
|
|
829
|
-
- (void)viewDidLoad {
|
|
830
|
-
// 创建会话信息
|
|
831
|
-
TUIChatConversationModel *conversationData = [[TUIChatConversationModel alloc] init];
|
|
832
|
-
// 1v1 会话仅传 userID,群组会话仅传 groupID。
|
|
833
|
-
conversationData.userID = @"userID";
|
|
834
|
-
conversationData.groupID = @"groupID";
|
|
835
|
-
|
|
836
|
-
// 创建 chatVC
|
|
837
|
-
TUIBaseChatViewController_Minimalist *chatVC = nil;
|
|
838
|
-
if (conversationData.groupID.length > 0) {
|
|
839
|
-
chatVC = [[TUIGroupChatViewController_Minimalist alloc] init];
|
|
840
|
-
} else if (conversationData.userID.length > 0) {
|
|
841
|
-
chatVC = [[TUIC2CChatViewController_Minimalist alloc] init];
|
|
842
|
-
}
|
|
843
|
-
[chatVC setConversationData:conversationData];
|
|
844
|
-
|
|
845
|
-
// 把 chatVC 添加到自己的 ViewController 上
|
|
846
|
-
[self addChildViewController:vc];
|
|
847
|
-
[self.view addSubview:vc.view];
|
|
848
|
-
}
|
|
849
|
-
@end
|
|
850
|
-
```
|
|
851
|
-
|
|
852
|
-
## 常见问题
|
|
853
|
-
|
|
854
|
-
### 上架常见问题
|
|
855
|
-
- **上架 Appstore 时打包失败,提示 Unsupported Architectures。**
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
问题现象如下图,打包时提示 ImSDK_Plus.framework 中包含了 Appstore 不支持的 x86_64 模拟器版本。该问题是由于 IMSDK 为了方便开发者调试,发布时会默认带上模拟器版本。
|
|
859
|
-
|
|
860
|
-

|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
您可以按照下面的步骤,在打包时去掉模拟器版本:
|
|
864
|
-
|
|
865
|
-
1. 选中您工程的 Target,并点击 Build Phases 选项,在当前面板中添加 Run Script;
|
|
866
|
-
|
|
867
|
-

|
|
868
|
-
|
|
869
|
-
2. 在新增的 Run Script 中,添加如下脚本:
|
|
870
|
-
|
|
871
|
-
``` bash
|
|
872
|
-
#!/bin/sh
|
|
873
|
-
|
|
874
|
-
# Strip invalid architectures
|
|
875
|
-
strip_invalid_archs() {
|
|
876
|
-
binary="$1"
|
|
877
|
-
echo "current binary ${binary}"
|
|
878
|
-
# Get architectures for current file
|
|
879
|
-
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
|
|
880
|
-
stripped=""
|
|
881
|
-
for arch in $archs; do
|
|
882
|
-
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
|
|
883
|
-
if [ -f "$binary" ]; then
|
|
884
|
-
# Strip non-valid architectures in-place
|
|
885
|
-
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
|
|
886
|
-
stripped="$stripped $arch"
|
|
887
|
-
fi
|
|
888
|
-
fi
|
|
889
|
-
done
|
|
890
|
-
if [[ "$stripped" ]]; then
|
|
891
|
-
echo "Stripped $binary of architectures:$stripped"
|
|
892
|
-
fi
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
|
|
896
|
-
|
|
897
|
-
# This script loops through the frameworks embedded in the application and
|
|
898
|
-
# removes unused architectures.
|
|
899
|
-
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
|
|
900
|
-
do
|
|
901
|
-
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
|
|
902
|
-
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
|
|
903
|
-
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
|
|
904
|
-
strip_invalid_archs "$FRAMEWORK_EXECUTABLE_PATH"
|
|
905
|
-
done
|
|
906
|
-
```
|
|
907
|
-

|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
### **Xcode15 集成常见问题**
|
|
911
|
-
- **[Xcodeproj] Unknown object version (60). (RuntimeError)**
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-

|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
使用 Xcode15 创建新工程来集成 TUIKit 时,输入**pod install** 后,可能会遇到此问题,原因是使用了较旧版本的 CocoaPods ,此时有两种解决办法:
|
|
918
|
-
|
|
919
|
-
- 解决方式一: 修改 Xcode 工程的 **Project Format **版本。
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-

|
|
923
|
-
|
|
924
|
-
- 解决方式二: 升级本地的 CocoaPods 版本,升级方式本文不再赘述。
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
您可以在终端输入 **pod --version** 查看当前的 Pods 版本。
|
|
928
|
-
|
|
929
|
-
- **-ld64链接器问题**
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
`Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp`
|
|
933
|
-
|
|
934
|
-

|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
或是使用 XCode15 集成 TUIRoom 时,因最新链接器导致 TUIRoomEngine 的符号冲突,都属于该问题。
|
|
938
|
-
|
|
939
|
-

|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
解决方式:修改链接器配置
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
在 **Build Settings** 中的**Other Linker Flags** 种添加"**-ld64**",即可解决。 详情可参见 [此文档](https://links.jianshu.com/go?to=https%3A%2F%2Fdeveloper.apple.com%2Fforums%2Fthread%2F735426)。
|
|
946
|
-
|
|
947
|
-

|
|
948
|
-
|
|
949
|
-
- **Rosetta 模拟器问题**
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
使用苹果芯片(m1\m2等系列芯片)时会遇到, 原因是包括 SDWebImage 在内的三方库,并未支持 xcframework,不过苹果依旧给出了适配办法,就是在模拟器上开启 Rosetta 设置, 一般情况下编译时会自动弹出 Rosetta 选项。
|
|
953
|
-
|
|
954
|
-

|
|
955
|
-
|
|
956
|
-
- **Xcode 15 开发者沙盒选项问题**
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
Sandbox: bash(xxx) deny(1) file-write-create
|
|
960
|
-
|
|
961
|
-

|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
当您使用 Xcode 15 创建一个新工程时, 可能会因为此选项导致编译运行失败,建议您关闭此选项。
|
|
965
|
-
|
|
966
|
-

|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
### CocoaPods 集成常见问题
|
|
970
|
-
- **使用远端集成时,Pod依赖版本不匹配问题**
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
若您[使用远端 Pods 集成时](https://write.woa.com/document/107052221686493184),出现 **Podfile.lock** 和 插件依赖的 TUICore 版本不一致时,
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
此时请删除 **Podfile.lock** 文件, 并使用 **pod repo update **更新本地代码仓库, 之后使用 **pod update** 重新更新即可。
|
|
977
|
-
|
|
978
|
-

|
|
979
|
-
|
|
980
|
-
- **使用本地集成时,Pod依赖版本不匹配问题**
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
若您[使用DevelopPods集成时](https://write.woa.com/document/107052221686493184) 出现 插件依赖的 **TUICore **版本较新,但本地 Pod 依赖的版本号是 **1.0.0** ,
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
此时请您参见 [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 中一致,正常情况下我们会帮您修改为一致。
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
第一次使用本地集成时,建议您下载我们的示例 Demo 工程,将 Podfile 文件内容替换为 Podfile_local 的内容,执行 **Pod update **后相互参照。
|
|
990
|
-
|
|
991
|
-

|
|
992
|
-
|
|
993
|
-
|