@tencentcloud/sdk-mcp 1.7.2 → 1.7.4
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/CHANGELOG.md +26 -0
- package/README.md +25 -17
- package/knowledge/bm25.js +20 -11
- package/knowledge/path-meta.js +23 -1
- package/knowledge/search/generic-rerank.js +123 -0
- package/knowledge/search/search-pass.js +8 -1
- package/package.json +1 -1
- package/resource/_schema/query-normalization.yaml +6 -0
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +4 -0
- package/resource/integration/callkit/preset/flutter/integration.md +4 -0
- package/resource/integration/callkit/preset/ios/integration.md +14 -13
- package/resource/integration/callkit/preset/vue/integration.md +0 -3
- package/resource/integration/chat/preset/android/integration.md +35 -173
- package/resource/integration/chat/preset/flutter/integration.md +113 -220
- package/resource/integration/chat/preset/ios/integration.md +2 -269
- package/resource/integration/chat/preset/react/integration.md +27 -1
- package/resource/integration/chat/preset/uni-app/integration.md +5 -1
- package/resource/integration/chat/preset/vue/integration.md +21 -31
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +4 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +4 -0
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +3 -4
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -1
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -1
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +4 -9
- package/resource/integration/roomkit/preset/vue/integration.md +0 -213
- package/resource/knowledge/callkit/best-practice/android/video-chat-dating.md +490 -0
- package/resource/knowledge/callkit/best-practice/flutter/android-keep-call-alive-background.md +79 -0
- package/resource/knowledge/callkit/best-practice/flutter/background-incoming-call-no-notification.md +99 -0
- package/resource/knowledge/callkit/best-practice/flutter/ios-keep-call-alive-background.md +93 -0
- package/resource/knowledge/callkit/best-practice/flutter/ios-startup-crash-version-voip.md +68 -0
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +1 -1
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +9 -7
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +10 -7
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +1 -1
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +19 -19
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +16 -16
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +0 -84
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +0 -102
- package/resource/knowledge/callkit/core-sdk/web/call-event.md +2 -2
- package/resource/knowledge/callkit/faq/error-code.md +62 -36
- package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +1 -1
- package/resource/knowledge/callkit/preset/android/api.md +10 -10
- package/resource/knowledge/callkit/preset/harmonyos/api.md +362 -0
- package/resource/knowledge/callkit/preset/harmonyos/integration.md +322 -0
- package/resource/knowledge/callkit/preset/ios/api.md +9 -9
- package/resource/knowledge/callkit/preset/miniprogram/api-uniapp.md +293 -0
- package/resource/knowledge/callkit/preset/miniprogram/api.md +19 -19
- package/resource/knowledge/callkit/preset/miniprogram/integration.md +292 -0
- package/resource/knowledge/callkit/preset/miniprogram/uniapp-integration.md +521 -0
- package/resource/knowledge/callkit/preset/uni-app/api.md +49 -0
- package/resource/knowledge/callkit/preset/uni-app/integration.md +353 -0
- package/resource/knowledge/chat/best-practice/common/web-sdk-log-level.md +76 -0
- package/resource/knowledge/chat/best-practice/miniprogram/desktop-wechat-miniprogram-error.md +79 -0
- package/resource/knowledge/chat/best-practice/miniprogram/login-timeout-2801-diagnosis.md +1 -1
- package/resource/knowledge/chat/preset/android-view/integration.md +84 -124
- package/resource/knowledge/chat/preset/ios/features/language.md +5 -5
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +184 -923
- package/resource/knowledge/chat/preset/react/features/search.md +9 -214
- package/resource/knowledge/chat/preset/react/h5/integration.md +965 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +0 -36
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +0 -34
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +0 -39
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +0 -74
- package/resource/knowledge/chat/preset/vue/features/search.md +9 -790
- package/resource/knowledge/chat/preset/vue/h5/integration.md +724 -0
- package/resource/knowledge/livekit/core-sdk/features/uni-app/live-list.md +0 -167
- package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +2 -2
- package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +1 -66
- package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +1 -66
- package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +1 -1
- package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/uni-app/integration.md +2 -2
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +1 -24
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +0 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +0 -5
- package/resource/knowledge/push/api-reference/harmonyos.md +9 -9
- package/resource/knowledge/push/api-reference/unity.md +10 -10
- package/resource/knowledge/push/api-reference/unreal-engine.md +11 -11
- package/resource/knowledge/push/config/android/fcm.md +2 -6
- package/resource/knowledge/push/integration/android.md +824 -428
- package/resource/knowledge/push/integration/donut.md +57 -74
- package/resource/knowledge/push/integration/flutter.md +208 -63
- package/resource/knowledge/push/integration/harmonyos.md +6 -11
- package/resource/knowledge/push/integration/ios.md +44 -99
- package/resource/knowledge/push/integration/react-native.md +3 -2
- package/resource/knowledge/push/integration/uni-app.md +29 -107
- package/resource/knowledge/push/integration/unity.md +3 -2
- package/resource/knowledge/push/integration/unreal-engine.md +4 -3
- package/resource/knowledge/roomkit/best-practice/vue/screen-share-auto-stop-on-leave.md +62 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +4 -4
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +4 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +4 -4
- package/resource/knowledge/roomkit/core-sdk/react/network-proxy.md +84 -0
- package/resource/knowledge/roomkit/core-sdk/vue/device-detection.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/network-proxy.md +84 -0
- package/resource/knowledge/roomkit/core-sdk/vue/recording.md +245 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -16
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/whiteboard-annotation.md +181 -0
- package/resource/knowledge/roomkit/faq/error-code.md +103 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +1 -202
- package/resource/knowledge/roomkit/preset/flutter/integration.md +13 -13
- package/resource/knowledge/roomkit/preset/harmonyos/integration.md +465 -0
- package/resource/knowledge/roomkit/preset/ios/integration.md +0 -201
- package/resource/knowledge/roomkit/preset/react/features/network-proxy.md +80 -0
- package/resource/knowledge/roomkit/preset/react/integration.md +0 -202
- package/resource/knowledge/roomkit/preset/uniapp-app/integration.md +279 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-caption-translation.md +69 -0
- package/resource/knowledge/roomkit/preset/vue/features/ai-denoiser.md +67 -0
- package/resource/knowledge/roomkit/preset/vue/features/network-proxy.md +80 -0
- package/resource/knowledge/roomkit/preset/vue/features/recording.md +85 -0
- package/resource/knowledge/roomkit/preset/vue/features/whiteboard-annotation.md +86 -0
- package/resource/knowledge/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +25 -6
- package/server.js +1 -1
- package/utils/preflight-route.js +18 -6
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -49,14 +49,15 @@ TUIKit 提供了一套完整的即时通信 UI 组件,向下依赖 AtomicXCore
|
|
|
49
49
|
## 集成并引入组件
|
|
50
50
|
|
|
51
51
|
> **说明:**
|
|
52
|
-
> **Demo**:[GitHub 完整 Demo](https://github.com/Tencent-RTC/TUIKit_Flutter) 开箱即用,5 分钟跑通聊天 + 音视频通话全功能。
|
|
52
|
+
> **Demo**:[CNB 完整 Demo(国内)](https://cnb.cool/tencent/cloud/trtc/TUIKit_Flutter) 或者 [GitHub 完整 Demo](https://github.com/Tencent-RTC/TUIKit_Flutter) 开箱即用,5 分钟跑通聊天 + 音视频通话全功能。
|
|
53
53
|
>
|
|
54
54
|
|
|
55
55
|
### 下载源码
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
从 CNB 下载 [TUIKit Flutter](https://cnb.cool/tencent/cloud/trtc/TUIKit_Flutter) 源码或者 GitHub 下载 [TUIKit Flutter](https://github.com/Tencent-RTC/TUIKit_Flutter) 源码:
|
|
58
58
|
``` xml
|
|
59
|
-
git clone https://
|
|
59
|
+
git clone https://cnb.cool/tencent/cloud/trtc/TUIKit_Flutter
|
|
60
|
+
// 或者 git clone https://github.com/Tencent-RTC/TUIKit_Flutter.git
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
项目目录结构说明:
|
|
@@ -107,7 +108,7 @@ call/
|
|
|
107
108
|
|
|
108
109
|
### 配置项目
|
|
109
110
|
|
|
110
|
-
|
|
111
|
+
【iOS】
|
|
111
112
|
|
|
112
113
|
在 iOS 端添加必要的权限配置。请打开 ios/Podfile ,在文件末尾新增如下权限代码:
|
|
113
114
|
``` objectivec
|
|
@@ -132,13 +133,13 @@ end
|
|
|
132
133
|
|
|
133
134
|
```
|
|
134
135
|
|
|
135
|
-
|
|
136
|
+
【Android】
|
|
136
137
|
- **清理 Gradle 全局配置:**如果您本地存在 `~/.gradle/init.gradle`,运行如下命令:
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
``` bash
|
|
140
|
+
# 或者直接删除:rm -f ~/.gradle/init.gradle
|
|
141
|
+
mv ~/.gradle/init.gradle ~/.gradle/init.gradle.backup
|
|
142
|
+
```
|
|
142
143
|
|
|
143
144
|
> **说明:**
|
|
144
145
|
>
|
|
@@ -147,101 +148,101 @@ end
|
|
|
147
148
|
|
|
148
149
|
- **配置 JDK 17:**在项目例如 `chat/demo` 目录下的 `gradle.properties` 里增加一条 `org.gradle.java.home`,用来配置 JDK 17 路径,请替换成您实际的 JDK 17 的完整路径。参考如下:
|
|
149
150
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
``` bash
|
|
152
|
+
# 请替换为您本地 JDK 17 的真实完整路径
|
|
153
|
+
org.gradle.java.home=xx/Java/JavaVirtualMachines/jdk-17.0.6.jdk/Contents/Home
|
|
154
|
+
```
|
|
154
155
|
|
|
155
|
-
|
|
156
|
+
【HarmonyOS】
|
|
156
157
|
- 参考 [鸿蒙 Flutter 仓库文档](https://gitcode.com/CPF-Flutter/flutter_flutter/tree/oh-3.35.7-release) 的开发指南搭建环境。
|
|
157
158
|
|
|
158
159
|
- 在您项目的 `pubspec.yaml` 文件中依赖重写(dependency_overrides)鸿蒙适配的第三方库,参考 `chat/demo/pubspec.yaml` 文件:
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
161
|
+
``` javascript
|
|
162
|
+
dependency_overrides:
|
|
163
|
+
# ... 已有的 override 保持不变 ...
|
|
164
|
+
# HarmonyOS 专用(仅在使用 Flutter-OH 构建时启用,构建 Android/iOS 时请注释掉)
|
|
165
|
+
|
|
166
|
+
path_provider:
|
|
167
|
+
git:
|
|
168
|
+
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
|
|
169
|
+
path: "packages/path_provider/path_provider"
|
|
170
|
+
ref: "provider-v2.1.5-ohos-1.0.0"
|
|
171
|
+
shared_preferences:
|
|
172
|
+
git:
|
|
173
|
+
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
|
|
174
|
+
path: "packages/shared_preferences/shared_preferences"
|
|
175
|
+
ref: "shared_preferences-v2.5.4-ohos-1.0.0"
|
|
176
|
+
url_launcher:
|
|
177
|
+
git:
|
|
178
|
+
url: "https://gitcode.com/openharmony-tpc/flutter_packages.git"
|
|
179
|
+
path: "packages/url_launcher/url_launcher"
|
|
180
|
+
ref: "url_launcher_v6.3.2-ohos-1.0.0"
|
|
180
181
|
|
|
181
|
-
|
|
182
|
+
```
|
|
182
183
|
- 声明 HarmonyOS 权限,参考 `chat/demo/ohos/entry/src/main/module.json5` 在 `requestPermissions` 数组中加入所需权限。
|
|
183
184
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
185
|
+
``` java
|
|
186
|
+
{
|
|
187
|
+
"module": {
|
|
188
|
+
"requestPermissions": [
|
|
189
|
+
// ===== system_grant(声明即得) =====
|
|
190
|
+
{ "name": "ohos.permission.INTERNET" },
|
|
191
|
+
{ "name": "ohos.permission.GET_NETWORK_INFO" },
|
|
192
|
+
{ "name": "ohos.permission.VIBRATE" },
|
|
193
|
+
// ===== user_grant(需运行时申请,必须提供 reason 和 usedScene) =====
|
|
194
|
+
{
|
|
195
|
+
"name": "ohos.permission.CAMERA",
|
|
196
|
+
"reason": "$string:permission_reason_camera",
|
|
197
|
+
"usedScene": {
|
|
198
|
+
"abilities": [ "EntryAbility" ],
|
|
199
|
+
"when": "inuse"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "ohos.permission.MICROPHONE",
|
|
204
|
+
"reason": "$string:permission_reason_microphone",
|
|
205
|
+
"usedScene": {
|
|
206
|
+
"abilities": [ "EntryAbility" ],
|
|
207
|
+
"when": "inuse"
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "ohos.permission.WRITE_IMAGEVIDEO",
|
|
212
|
+
"reason": "$string:permission_reason_write_media",
|
|
213
|
+
"usedScene": {
|
|
214
|
+
"abilities": [ "EntryAbility" ],
|
|
215
|
+
"when": "inuse"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "ohos.permission.READ_PASTEBOARD",
|
|
220
|
+
"reason": "$string:permission_reason_read_pasteboard",
|
|
221
|
+
"usedScene": {
|
|
222
|
+
"abilities": [ "EntryAbility" ],
|
|
223
|
+
"when": "inuse"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
}
|
|
228
229
|
|
|
229
|
-
|
|
230
|
+
```
|
|
230
231
|
- 在项目根目录 `ohos/build-profile.json5` 里启用 `useNormalizedOHMUrl`,否则会报“Bytecode HARs not supported when useNormalizedOHMUrl is not true”的错误。
|
|
231
232
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
``` java
|
|
234
|
+
{
|
|
235
|
+
"app": {
|
|
236
|
+
"products": [{
|
|
237
|
+
"name": "default",
|
|
238
|
+
"buildOption": {
|
|
239
|
+
"arkOptions": { "useNormalizedOHMUrl": true }
|
|
240
|
+
}
|
|
241
|
+
}]
|
|
242
|
+
}
|
|
243
|
+
}
|
|
243
244
|
|
|
244
|
-
|
|
245
|
+
```
|
|
245
246
|
|
|
246
247
|
## 接入步骤
|
|
247
248
|
|
|
@@ -260,6 +261,7 @@ final result = await LoginStore.shared.login(
|
|
|
260
261
|
);
|
|
261
262
|
if (result.errorCode == 0) {
|
|
262
263
|
// 登录成功,可跳转聊天或会话页
|
|
264
|
+
TUICallKit.instance.login(SDKAPPID, userID, userSig);
|
|
263
265
|
} else {
|
|
264
266
|
// 登录失败,可弹框报错
|
|
265
267
|
}
|
|
@@ -269,63 +271,7 @@ if (result.errorCode == 0) {
|
|
|
269
271
|
> 在正式的生产环境中,请在您的服务端生成 UserSig,在需要 UserSig 时由您的 App 向业务服务器发起请求获取动态 UserSig 来进行鉴权。详见 [服务端生成 UserSig](https://cloud.tencent.com/document/product/269/32688)。
|
|
270
272
|
>
|
|
271
273
|
|
|
272
|
-
### 步骤3
|
|
273
|
-
|
|
274
|
-
您可以基于 TUIKit Flutter 中的 ConversationList 组件,构建一个会话列表页面。ConversationList 内建的功能是:
|
|
275
|
-
- 展示用户的会话列表,包含单聊和群聊会话
|
|
276
|
-
|
|
277
|
-
- 支持用户操作单个会话:置顶、删除、清空会话消息等
|
|
278
|
-
|
|
279
|
-
将 ConversationList 封装为会话列表页,可参考 `chat/uikit/lib/src/pages/conversations_page.dart` 文件里的实现,`ConversationsPage` 主要做了以下工作:
|
|
280
|
-
|
|
281
|
-
1. 在 ConversationList 上方添加了 AppBar。
|
|
282
|
-
|
|
283
|
-
2. 实现点击会话列表 cell 事件。
|
|
284
|
-
|
|
285
|
-
3. 支持创建会话和群组功能:
|
|
286
|
-
|
|
287
|
-
1. 点击右上角按钮可以创建新会话或群组
|
|
288
|
-
|
|
289
|
-
2. 支持从联系人列表选择好友创建单聊
|
|
290
|
-
|
|
291
|
-
3. 支持选择多个好友创建群聊
|
|
292
|
-
|
|
293
|
-
核心示例代码如下所示:
|
|
294
|
-
|
|
295
|
-
``` java
|
|
296
|
-
@override
|
|
297
|
-
Widget build(BuildContext context) {
|
|
298
|
-
return Scaffold(
|
|
299
|
-
appBar: AppBar(
|
|
300
|
-
backgroundColor: colorsTheme.bgColorOperate,
|
|
301
|
-
title: Text(atomicLocale.chat, style: TextStyle(fontSize: 34, fontWeight: FontWeight.w600)),
|
|
302
|
-
centerTitle: false,
|
|
303
|
-
scrolledUnderElevation: 0,
|
|
304
|
-
actions: [],
|
|
305
|
-
),
|
|
306
|
-
body: Column(
|
|
307
|
-
children: [
|
|
308
|
-
Expanded(
|
|
309
|
-
child: ConversationList(
|
|
310
|
-
onConversationClick: (conversation) {
|
|
311
|
-
Navigator.push(
|
|
312
|
-
context,
|
|
313
|
-
MaterialPageRoute(
|
|
314
|
-
builder: (context) => ChatPage(
|
|
315
|
-
conversation: conversation,
|
|
316
|
-
),
|
|
317
|
-
),
|
|
318
|
-
);
|
|
319
|
-
},
|
|
320
|
-
),
|
|
321
|
-
),
|
|
322
|
-
],
|
|
323
|
-
),
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### 步骤4:构建聊天界面
|
|
274
|
+
### 步骤3:构建聊天界面
|
|
329
275
|
|
|
330
276
|
您可以基于 TUIKit Flutter 中的 MessageList、MessageInput 组件,构建一个聊天页面。
|
|
331
277
|
|
|
@@ -401,82 +347,14 @@ MessageList 内建的功能是:
|
|
|
401
347
|
}
|
|
402
348
|
```
|
|
403
349
|
|
|
404
|
-
### 步骤
|
|
405
|
-
|
|
406
|
-
您可以基于 TUIKit Flutter 中的 ContactList 组件,构建一个联系人页面。ContactList 内建的功能是:
|
|
407
|
-
- 查看好友申请列表。
|
|
408
|
-
|
|
409
|
-
- 查看已加入的群列表。
|
|
410
|
-
|
|
411
|
-
- 处理群组邀请和申请。
|
|
412
|
-
|
|
413
|
-
- 管理黑名单列表。
|
|
414
|
-
|
|
415
|
-
- 查看好友。
|
|
416
|
-
|
|
417
|
-
将 ContactList 封装为联系人列表页,可参考 `chat/uikit/lib/src/pages/contacts_page.dart` 文件里的实现,`ContactsPage` 主要做了以下工作:
|
|
418
|
-
|
|
419
|
-
1. 在 ContactList 上方添加了 AppBar。
|
|
420
|
-
|
|
421
|
-
2. 实现点击联系人列表 cell 事件。
|
|
422
|
-
|
|
423
|
-
3. 支持添加联系人和添加群组:
|
|
424
|
-
|
|
425
|
-
1. 点击右上角 "+" 按钮可以添加联系人或群组
|
|
426
|
-
|
|
427
|
-
2. 支持根据 UserID 搜索目标联系人
|
|
350
|
+
### 步骤4:音视频通话
|
|
428
351
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
核心示例代码如下所示:
|
|
432
|
-
|
|
433
|
-
``` java
|
|
434
|
-
@override
|
|
435
|
-
Widget build(BuildContext context) {
|
|
436
|
-
AtomicLocalizations atomicLocale = AtomicLocalizations.of(context);
|
|
437
|
-
SemanticColorScheme colorsScheme = BaseThemeProvider.colorsOf(context);
|
|
438
|
-
return Scaffold(
|
|
439
|
-
appBar: AppBar(
|
|
440
|
-
backgroundColor: colorsScheme.bgColorOperate,
|
|
441
|
-
title: Text(atomicLocale.contact, style: TextStyle(fontSize: 34, fontWeight: FontWeight.w600),),
|
|
442
|
-
centerTitle: false,
|
|
443
|
-
scrolledUnderElevation: 0,
|
|
444
|
-
actions: [],
|
|
445
|
-
),
|
|
446
|
-
body: ContactList(
|
|
447
|
-
onGroupClick: (ContactInfo contactInfo) {
|
|
448
|
-
_onGroupClick(context, contactInfo);
|
|
449
|
-
},
|
|
450
|
-
onContactClick: (ContactInfo contactInfo) {
|
|
451
|
-
_onContactClick(context, contactInfo);
|
|
452
|
-
},
|
|
453
|
-
),
|
|
454
|
-
);
|
|
455
|
-
}
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
### 步骤6:完善界面间的跳转逻辑
|
|
459
|
-
|
|
460
|
-
ConversationsPage、ChatPage、ContactsPage 中实现了默认的用户点击事件,您可以自定义事件来实现页面间的交互:
|
|
461
|
-
| Page | 回调 | 建议跳转逻辑 |
|
|
462
|
-
| --- | --- | --- |
|
|
463
|
-
| <strong>ConversationsPage</strong> | <code>onConversationClick: (conversation) {}</code> | 点击会话列表中的会话时触发,建议跳转到聊天页面(ChatPage)。 |
|
|
464
|
-
| <strong>ContactsPage</strong> | <code>onContactClick: (ContactInfo contactInfo) {}</code> | 点击联系人 cell 时触发,建议跳转到用户信息页(C2CChatSetting)。 |
|
|
465
|
-
| <code>onGroupClick: (ContactInfo contactInfo) {}</code> | 点击群组 cell 时触发,建议跳转到群聊页面(ChatPage)。 | |
|
|
466
|
-
| <strong>ChatPage</strong> | <code>onUserClick: (String userID) {}</code> | 点击消息中的用户头像或昵称时触发,建议跳转到用户信息页(C2CChatSetting)。 |
|
|
467
|
-
| <code>onChatHeaderClick: () {}</code> | 点击导航栏中的头像时触发,建议跳转到用户信息页(C2CChatSetting)或群聊信息页(GroupChatSetting) | |
|
|
468
|
-
| <code>onBackClick: () {}</code> | 点击返回按钮时触发,建议返回上一级页面。 | |
|
|
469
|
-
|
|
470
|
-
您可以参考上述回调说明及代码,实现 Page 之间交互逻辑。
|
|
471
|
-
|
|
472
|
-
### 步骤7:音视频通话(推荐)
|
|
473
|
-
|
|
474
|
-
在聊天中支持音视频通话,请先 [开通音视频服务](https://console.cloud.tencent.com/im),登录后即可在 Chat 组件中正常使用该功能。
|
|
352
|
+
在 `LoginStore` 登录成功后,登录 `TUICallKit` 即可在 Chat 组件中正常使用该功能。如需开通音视频通话服务,
|
|
475
353
|
``` javascript
|
|
476
354
|
TUICallKit.instance.login(SDKAPPID, userID, userSig);
|
|
477
355
|
```
|
|
478
356
|
|
|
479
|
-
### 步骤
|
|
357
|
+
### 步骤5:接入智能客服 Desk 用户端
|
|
480
358
|
|
|
481
359
|
若需同时集成智能客服 Desk 用户端,请先 [开通智能客服 Desk 服务](https://cloud.tencent.com/document/product/269/96059),并根据 [Flutter 接入智能客服用户端](https://cloud.tencent.com/document/product/269/113293) 文档完成 `tencentcloud_ai_desk_customer` 包引入和配置,即可在您的应用中引入客服会话能力。
|
|
482
360
|
``` java
|
|
@@ -508,3 +386,18 @@ TencentCloudAIDeskCustomer.navigate(
|
|
|
508
386
|
|
|
509
387
|
请检查 SDKAppID 和 UserSig 是否正确,UserSig 是否已过期。可以参考上文 配置用户鉴权 重新生成 UserSig。
|
|
510
388
|
|
|
389
|
+
### **如何移除音视频通话功能?**
|
|
390
|
+
|
|
391
|
+
如果您不需要集成音视频通话功能,请在 `pubspec.yaml` 文件中移除 `tencent_calls_uikit` 依赖,并在 步骤3 构建聊天界面 中关闭音视频通话开关,代码如下所示:
|
|
392
|
+
``` javascript
|
|
393
|
+
ChatMessageInputConfig messageInputConfig = const ChatMessageInputConfig(
|
|
394
|
+
isShowAudioCall: false,
|
|
395
|
+
isShowVideoCall: false,
|
|
396
|
+
);
|
|
397
|
+
MessageInput(
|
|
398
|
+
key: _messageInputKey,
|
|
399
|
+
conversationID: widget.conversation.conversationID,
|
|
400
|
+
config: widget.messageInputConfig,
|
|
401
|
+
),
|
|
402
|
+
```
|
|
403
|
+
|