@tencent-rtc/mcp 1.0.1 → 1.0.3
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/README.md +38 -37
- package/package.json +1 -1
- package/resource/doc/chatuikit/android/client_api_Android.md +1373 -0
- package/resource/doc/chatuikit/android/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/android/integrarte_only_tuichat_Android.md +290 -0
- package/resource/doc/chatuikit/android/integrate_tuikit_Android.md +287 -0
- package/resource/doc/chatuikit/android/quick_start_Android.md +138 -0
- package/resource/doc/chatuikit/android/show_typing_Android.md +43 -0
- package/resource/doc/chatuikit/faq/faq_sdk.md +120 -0
- package/resource/doc/chatuikit/faq/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/flutter/client_api_Flutter.md +932 -0
- package/resource/doc/chatuikit/flutter/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/flutter/integrate_only_tuichat_Flutter.md +333 -0
- package/resource/doc/chatuikit/flutter/integrate_tuikit_Flutter.md +769 -0
- package/resource/doc/chatuikit/flutter/quick_start_Flutter.md +217 -0
- package/resource/doc/chatuikit/iOS/client_api_iOS.md +1121 -0
- package/resource/doc/chatuikit/iOS/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/iOS/integrate_only_tuichat_iOS.md +748 -0
- package/resource/doc/chatuikit/iOS/integrate_tuikit_iOS.md +852 -0
- package/resource/doc/chatuikit/iOS/quick_start_iOS.md +163 -0
- package/resource/doc/chatuikit/iOS/show_typing_iOS.md +52 -0
- package/resource/doc/chatuikit/react/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/react/integrate_tuichat_only_react.md +202 -0
- package/resource/doc/chatuikit/react/integrate_tuichat_react.md +279 -0
- package/resource/doc/chatuikit/vue/generate_UserSig.md +306 -0
- package/resource/doc/chatuikit/vue/integrate_only_tuichat_Vue_web.md +124 -0
- package/resource/doc/chatuikit/vue/integrate_tuikit_Vue_web.md +552 -0
- package/resource/doc/tuicallkit/react/how_to_integrated_react_callkit.md +84 -55
- package/server.js +51 -27
- package/server.js.map +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Flutter Chat UIKit is designed to provide developers with a comprehensive set of tools to create feature-rich chat applications with ease.
|
|
2
|
+
|
|
3
|
+
It is built with a modular approach, allowing you to pick and choose the components you need while keeping your application lightweight and efficient.
|
|
4
|
+
|
|
5
|
+
The UIKit includes a wide range of capabilities, such as Conversation list, Message handling,
|
|
6
|
+
|
|
7
|
+
Contact lists, Message Translation, Speech-to-Text, and more.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
1. **Personalized Appearance** : With built-in **Dark and Light **modes, the UIKit offers a variety of **theme and appearance customization** options to meet your business needs.
|
|
14
|
+
|
|
15
|
+
2. **Multi-Platform Compatibility** : The adaptable single codebase ensures compatibility across various platforms, including **Mobile **devices (iOS/Android), **Tablet **(iPad and Android tablets), **Web **browsers, and **Desktop **environments (Windows/macOS).
|
|
16
|
+
|
|
17
|
+
3. **Localization Support** : Developed with native English and additional language options, including Arabic, Japanese, Korean, Simplified Chinese, and Traditional Chinese. The internationalization features ensure a localized interface language and support custom and **supplementary language** , with Arabic support for **RTL** UI.
|
|
18
|
+
|
|
19
|
+
4. **Enhanced Performance** : The UIKit delivers improved message list **performance** , **memory usage** , and precise message positioning capabilities, catering to scenarios with large message volumes and navigation to older messages.
|
|
20
|
+
|
|
21
|
+
5. **Advanced Features** : Boasting numerous advanced capabilities, the UIKit includes continuous voice message playback, enhanced multimedia and file message experiences, and intuitive left-right swiping for multimedia message previews.
|
|
22
|
+
|
|
23
|
+
6. **Refined User Experience** : Detail optimizations such as rich **animations** , **haptic feedback** , and **a polished interface** contribute to an improved user experience. New features like grid-style avatars, redesigned forwarding panels, group member selectors, and revamped long-press message menus further enrich the experience.
|
|
24
|
+
|
|
25
|
+
7. **Modular Design** : Components are organized into modular packages, allowing for selective importing and reducing unnecessary bloat. Each package supports **built-in navigation transitions** , streamlining development and integration by automatically handling transitions, such as between Conversation and Message.
|
|
26
|
+
|
|
27
|
+
8. **Developer-Friendly Approach** : A more unified, standardized component parameter design, clearer code naming conventions, and detailed comments, combined with the flexibility to choose **global or instance-level configuration ** management, make development easier and more efficient.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
### Requirements
|
|
33
|
+
- Flutter version: 3.19 or above
|
|
34
|
+
|
|
35
|
+
- Dart version: 3.0 or above
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Setting Up Application in the Console
|
|
39
|
+
|
|
40
|
+
#### **Step1:Create an Account**
|
|
41
|
+
|
|
42
|
+
Visit the [Console](https://trtc.io/login?source=flutter_article_blog_1&utm_campaign=social) of trtc.io and create an account by following the prompts.
|
|
43
|
+
|
|
44
|
+
#### **Step2:Start a Free Trial**
|
|
45
|
+
|
|
46
|
+
Create an application on the homepage and start your free trial.
|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
#### **Step3:Generate Test Users**
|
|
52
|
+
|
|
53
|
+
Create two users (test accounts) on [Account Management](https://console.trtc.io/chat/account-management). Following by use the [UserSig Tools](https://console.trtc.io/usersig) to create the corresponding UserSigs for them, note down the UserSigs for later use.
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
#### **Step4:Retrieve Your SDKAppID**
|
|
59
|
+
|
|
60
|
+
Go to [Applications](https://console.trtc.io/app), select your newly created application, and navigate to the corresponding [Application Overview](https://console.trtc.io/overview) to find your SDKAppID.
|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
At this point, the Console setup is complete. Make sure to note down the `SDKAppID `and the two sets of `UserID `and `UserSig`.
|
|
66
|
+
|
|
67
|
+
### Coding
|
|
68
|
+
|
|
69
|
+
> **Note:**
|
|
70
|
+
>
|
|
71
|
+
|
|
72
|
+
> The guide provide a** Simplified Overview** of integrating with Flutter Chat UIKit only.
|
|
73
|
+
>
|
|
74
|
+
|
|
75
|
+
> For a detailed integration process, please refer to this guide: [Detailed Integration Guide](https://trtc.io/document/58585?platform=flutter&product=chat&menulabel=uikit).
|
|
76
|
+
>
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
To begin, it's best to have a Flutter project ready or create a new one to fully experience this tutorial. We recommend following the steps to [create a new Flutter project](https://docs.flutter.dev/get-started/codelab).
|
|
80
|
+
|
|
81
|
+
If you're interested in exploring a fully-fledged app with an extensive range of features, advanced capabilities, and customization options, please check out [This Repo](https://github.com/TencentCloud/chat-demo-flutter/tree/v2).
|
|
82
|
+
|
|
83
|
+
#### Step 1. Import the Packages
|
|
84
|
+
|
|
85
|
+
To get started, import the base package, tencent_cloud_chat_common.
|
|
86
|
+
``` bash
|
|
87
|
+
flutter pub add tencent_cloud_chat_common
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Next, import the UI component packages that suit your needs:
|
|
91
|
+
``` bash
|
|
92
|
+
flutter pub add tencent_cloud_chat_message
|
|
93
|
+
flutter pub add tencent_cloud_chat_conversation
|
|
94
|
+
flutter pub add tencent_cloud_chat_contact
|
|
95
|
+
flutter pub add tencent_cloud_chat_sticker
|
|
96
|
+
flutter pub add tencent_cloud_chat_message_reaction
|
|
97
|
+
flutter pub add tencent_cloud_chat_text_translate
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For demonstration purposes, we suggest importing all of them. However, in real-world projects, you can import packages based on your specific requirements.
|
|
101
|
+
|
|
102
|
+
The architecture of Flutter Chat UIKit is shown below:
|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
#### Step 2. Initial Setup for UIKit
|
|
108
|
+
|
|
109
|
+
Before you start using each Modular Package UI component, follow these initial setup steps:
|
|
110
|
+
|
|
111
|
+
**Global Configuration**
|
|
112
|
+
|
|
113
|
+
Replace your project's `MaterialApp` by `TencentCloudChatMaterialApp`.
|
|
114
|
+
|
|
115
|
+
This enables automatic management and configuration of language, theme (with material3), theme mode, and other settings. If you prefer manual configuration, refer to [Implement the global configuration for UIKit manually](https://trtc.io/document/58585?platform=flutter&product=chat&menulabel=uikit#ab6bd508-218a-4002-9b76-0ee081e8929a).
|
|
116
|
+
|
|
117
|
+
**Initialization and Login**
|
|
118
|
+
|
|
119
|
+
Call `TencentCloudChat.controller.initUIKit` to initialize and log in.
|
|
120
|
+
|
|
121
|
+
Pass in the **SDKAppID**, **userID**, and **userSig **of your Tencent Cloud Chat application created in the previous step. Also, declare the register of each sub Modular UI Package in the `usedComponentsRegister` list.
|
|
122
|
+
``` java
|
|
123
|
+
TencentCloudChat.controller.initUIKit(
|
|
124
|
+
options: const TencentCloudChatInitOptions(
|
|
125
|
+
sdkAppID: , /// [Required]: The SDKAppID of your Tencent Cloud Chat application
|
|
126
|
+
userID: , /// [Required]: The userID of the logged-in user
|
|
127
|
+
userSig: , /// [Required]: The userSig of the logged-in user
|
|
128
|
+
),
|
|
129
|
+
components: const TencentCloudChatInitComponentsRelated( /// [Required]: The modular UI components related settings, taking effects on a global scale.
|
|
130
|
+
usedComponentsRegister: [
|
|
131
|
+
/// [Required]: List of registration functions for the components used in the Chat UIKit.
|
|
132
|
+
TencentCloudChatConversationManager.register,
|
|
133
|
+
TencentCloudChatMessageManager.register,
|
|
134
|
+
TencentCloudChatContactManager.register,
|
|
135
|
+
],
|
|
136
|
+
),
|
|
137
|
+
);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Perfect! With the global configuration complete, we're now ready to dive into the usage of our Modular UI Components. Let's explore how they can enhance your chat application experience.
|
|
141
|
+
|
|
142
|
+
#### Step3. Integrating Modular UI Components
|
|
143
|
+
|
|
144
|
+
In most use cases, you'll need to manually instantiate and add the `TencentCloudChatConversation` and `TencentCloudChatContact `components to a widget, if necessary.
|
|
145
|
+
|
|
146
|
+
Other components are automatically navigated based on user actions.
|
|
147
|
+
|
|
148
|
+
In this tutorial, we'll use the `bottomNavigationBar` to manage the pages and switch between the `TencentCloudChatConversation` and `TencentCloudChatContact `components.
|
|
149
|
+
|
|
150
|
+
First, declare a `currentIndex` variable and a `List<Widget> pages` array to indicate the currently selected component and store the component instances.
|
|
151
|
+
``` java
|
|
152
|
+
List<Widget> pages = [];
|
|
153
|
+
int currentIndex = 0;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Store the instances in the `pages` array.
|
|
157
|
+
``` java
|
|
158
|
+
pages = [
|
|
159
|
+
const TencentCloudChatConversation(),
|
|
160
|
+
const TencentCloudChatContact(),
|
|
161
|
+
];
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Finally, modify the `build` method as follows:
|
|
165
|
+
``` java
|
|
166
|
+
@override
|
|
167
|
+
Widget build(BuildContext context) {
|
|
168
|
+
return Scaffold(
|
|
169
|
+
bottomNavigationBar: BottomNavigationBar(
|
|
170
|
+
type: BottomNavigationBarType.fixed,
|
|
171
|
+
currentIndex: currentIndex,
|
|
172
|
+
onTap: (index) async {
|
|
173
|
+
if (index != currentIndex) {
|
|
174
|
+
setState(
|
|
175
|
+
() {
|
|
176
|
+
currentIndex = index;
|
|
177
|
+
},
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
items: const [
|
|
182
|
+
BottomNavigationBarItem(
|
|
183
|
+
icon: Icon(Icons.chat_bubble_outline), label: "Chats"),
|
|
184
|
+
BottomNavigationBarItem(
|
|
185
|
+
icon: Icon(Icons.contacts), label: "Contacts"),
|
|
186
|
+
],
|
|
187
|
+
),
|
|
188
|
+
body: pages[currentIndex],
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
And that's it! You've successfully integrated the components.
|
|
194
|
+
|
|
195
|
+
#### Step 4. Experience the Flutter Chat UIKit in Action
|
|
196
|
+
|
|
197
|
+
Now, let's run the project and experience the Flutter Chat UIKit.
|
|
198
|
+
|
|
199
|
+
Log in with the first test account created in the `initUIKit` method and launch the app.
|
|
200
|
+
|
|
201
|
+
Start by running `flutter run`.
|
|
202
|
+
|
|
203
|
+
Once you've successfully entered the app, you'll see the Conversation and Contact pages, with the ability to switch between them at the bottom.
|
|
204
|
+
|
|
205
|
+
However, there are no conversations to test yet.
|
|
206
|
+
|
|
207
|
+
Don't worry! Switch to the Contacts page, click 'Add Contact' in the top-right corner, and add the other test account as a contact. You'll now see the other account in the Contacts list.
|
|
208
|
+
|
|
209
|
+

|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
Click on the contact to start chatting. You can also rerun the app, log in with the other user's UserID, and experience sending messages to each other.
|
|
213
|
+
|
|
214
|
+
In conclusion, we've now completed the entire simplified integration process. Thank you for experiencing the power of Tencent Cloud Flutter Chat UIKit.
|
|
215
|
+
|
|
216
|
+
For more information on detailed integration, configuration, and advanced usage, please refer to this guide: [Detailed Integration Guide](https://www.tencentcloud.com/document/product/1047/58585).
|
|
217
|
+
|