diff --git a/README.md b/README.md index 28b933f..b2c569a 100644 --- a/README.md +++ b/README.md @@ -1,143 +1,42 @@ - - -
- -

- - Tencent Chat Logo - -

- -

Tencent Cloud Chat UIKit

- -
- -

- Globally interconnected In-App Chat, user profile and relationship chains and offline push. -

- -
- -

-More languages: - 简体中文-TUIKit介绍 - 简体中文-快速集成 -

- -
- -![](https://qcloudimg.tencent-cloud.cn/image/document/8fd972397eba8f56c8f294c8b042794c.jpg) - -

- TUIKit has Chat SDK, UI components and basic business logic inside. You can choose our pure Chat SDK tencent-cloud-chat-sdk if you tend to build the UI yourself. -

- - - -
+## Product Introduction +You only need to integrate Chat SDK to easily gain chat, conversation, group capabilities, and you can also communicate with other products such as whiteboards through signaling messages. Chat can cover various business scenarios, support the access and use of various platforms, and fully meet the communication needs. ## Check Out Our Sample Apps - -Experience our Chat and Voice/Video Call modules by trying out our sample apps. - -**These apps have been created using the same Flutter project as our SDKs and extensions.** - -| Platform | Link | Remark | -|---------|---------|---------| -| Android / iOS | Tencent Chat Logo | Scan to download app for both Android and iOS. Automatically identifies platform. | -| Web | Tencent Chat Logo | Supports both desktop and mobile browsers and automatically adjusts its layout accordingly. Same website as link below. | -| Web | [Visit Now](https://comm.qq.com/flutter/#/) | Supports both desktop and mobile browsers and automatically adjusts its layout accordingly. Same website as previous QR code. | -| macOS | [Download Now](https://comm.qq.com/im_demo_download/macos_flutter.dmg) | The macOS version of our sample app. Control-click the app icon, then choose "Open" from the shortcut menu. | -| Windows | [Download Now](https://comm.qq.com/im_demo_download/windows_flutter.appx) | The Windows version of our sample app, which is a UWP (Universal Windows Platform) application. | -| Linux | Coming Soon... | Will be available later this year. | - -**Take a look at the screenshots of -TUIKit [here](https://www.tencentcloud.com/document/product/1047/50059?from=pub) to get an idea of -what to expect.** - +This document introduces how to quickly run the Chat demo on the iOS platform. +For the other platforms, please refer to document: +- [**chat-uikit-android**](https://github.com/TencentCloud/chat-uikit-android) +- [**chat-uikit-ios**](https://github.com/TencentCloud/chat-uikit-ios) +- [**chat-uikit-vue**](https://github.com/TencentCloud/chat-uikit-vue) +- [**chat-uikit-react**](https://github.com/TencentCloud/chat-uikit-react) +- [**chat-uikit-uniapp**](https://github.com/TencentCloud/chat-uikit-uniapp) +- [**chat-uikit-wechat**](https://github.com/TencentCloud/chat-uikit-wechat) + ## Introduction to TUIKit +Chat SDK comes with TUIKit, which is an official set of UI components that have chat business logic built-in. TUIKit includes components like conversation, chat, relationship chain, and group. +See [TUIKit Library Overview](https://trtc.io/document/50059?platform=flutter&product=chat&menulabel=uikit) for more details. -Tencent Cloud Chat SDK comes -with [TUIKit](https://www.tencentcloud.com/document/product/1047/50059?from=pub), which is an -official set of UI components that have chat business logic built-in. TUIKit includes components -like conversation, chat, relationship chain, and group. +Developers can use these UI components to quickly and easily add In-APP chat modules to their mobile applications. + -Developers can use these UI components to quickly and easily add In-APP chat modules to their mobile -applications. - -![img](https://qcloudimg.tencent-cloud.cn/raw/f140dd76be01a65abfb7e6ba2bf50ed5.png) - -Currently, Flutter [TUIKit](https://www.tencentcloud.com/document/product/1047/50059?from=pub) +Currently, Flutter TUIKit contains the following main components: -- [TIMUIKitCore](https://comm.qq.com/im/doc/flutter/en/TUIKit/TIMUIKitCore/readme.html): Core entry -- [TIMUIKitConversation](https://www.tencentcloud.com/document/product/1047/50059?from=pub#timuikitconversation): - Conversation list -- [TIMUIKitChat](https://www.tencentcloud.com/document/product/1047/50059?from=pub#timuikitchat): - Chat module, includes historical message list and message sending area, with some other features +- TIMUIKitCore: Core entry +- TIMUIKitConversation: Conversation list +- TIMUIKitChat: Chat module, includes historical message list and message sending area, with some other features like message reaction and URL preview, etc. -- [TIMUIKitContact](https://www.tencentcloud.com/document/product/1047/50059?from=pub#relationship-chain-components): - Contacts list -- [TIMUIKitProfile](https://www.tencentcloud.com/document/product/1047/50059?from=pub#timuikitprofile): - User profile and relationship management -- [TIMUIKitGroupProfile](https://www.tencentcloud.com/document/product/1047/50059?from=pub#timuikitgroupprofile): - Group profile and management -- [TIMUIKitGroup](https://www.tencentcloud.com/document/product/1047/50059?from=pub#relationship-chain-components): - The list of group self joined -- [TIMUIKitBlackList](https://www.tencentcloud.com/document/product/1047/50059?from=pub#relationship-chain-components): - The list of user been blocked -- [TIMUIKitNewContact](https://www.tencentcloud.com/document/product/1047/50059?from=pub#relationship-chain-components): - New contacts application list -- [TIMUIKitSearch](https://www.tencentcloud.com/document/product/1047/50036?from=pub): Search - globally -- [TIMUIKitSearchMsgDetail](https://www.tencentcloud.com/document/product/1047/50036?from=pub): - Search in specific conversation +- TIMUIKitContact: Contacts list +- TIMUIKitProfile: User profile and relationship management +- TIMUIKitGroupProfile: Group profile and management +- TIMUIKitGroup: The list of group self joined +- TIMUIKitBlackList: The list of user been blocked +- TIMUIKitNewContact: New contacts application list +- TIMUIKitSearch: Search globally +- TIMUIKitSearchMsgDetail: Search in specific conversation In addition to these components, there are other useful components and widgets available to help developers meet their business needs, such as group entry application list and group member list. -For the source code of the project shown in the image above, please refer -to [chat-demo-flutter](https://github.com/TencentCloud/chat-demo-flutter). This project is open -source and can be directly used by developers. - ## Compatible Platforms The platforms are compatible with the deployment of our Chat UIKit. @@ -150,29 +49,20 @@ The platforms are compatible with the deployment of our Chat UIKit. ## Get Started -Please refer to [this document](https://www.tencentcloud.com/document/product/1047/45907?from=pub) for a complete and detailed guide on getting started. +Please refer to [Run Demo](https://trtc.io/document/45907?platform=flutter&product=chat&menulabel=uikit) for a complete and detailed guide on getting started. ## Directions The following guide describes how to quickly build a simple chat application using Flutter TUIKit. - Refer to the appendix if you want to learn about the details and parameters of each widget. -> If you want to directly add Flutter TUIKit to your existing application, refer to [this document](https://www.tencentcloud.com/document/product/1047/51456). You can add the Flutter module to your existing application, code once, and deploy to all platforms. This can significantly reduce the workload of adding chat and call modules to your existing application. - ### Step 0: Create two accounts for testing -Sign up and log in to the [Tencent Cloud Chat console](https://console.tencentcloud.com/im?from=pub). +Sign up and log in to the [Chat console](https://console.trtc.io/). -Create an application and enter it. +Create an application and enter it. Click Users and create two accounts. -Select Auxiliary Tools > UserSig Generation and Verification on the left sidebar. Generate two pairs of "UserID" and the corresponding "UserSig," and copy the "key" information. Refer to [this document](https://www.tencentcloud.com/document/product/1047/34580?from=pub#usersig-generation-and-verification). - -Tips: You can create "user1" and "user2" here. - -> Note: -> -> The correct way to distribute `UserSig` is to integrate the calculation code for `UserSig` into your server and provide an application-oriented API. When `UserSig` is needed, your application can send a request to the business server for a dynamic `UserSig.` For more information, see [How do I calculate UserSig on the server?](https://www.tencentcloud.com/document/product/1047/34385?from=pub). +> The correct way to distribute `UserSig` is to integrate the calculation code for `UserSig` into your server and provide an application-oriented API. When `UserSig` is needed, your application can send a request to the business server for a dynamic `UserSig.` For more information, see [How do I calculate UserSig on the server?](https://trtc.io/document/34385?product=chat&menulabel=serverapis). ### Step 1: Create a Flutter app and add permission configuration @@ -258,7 +148,8 @@ Open `web/index.html` and add the following two lines between `` and ` ``` -![](https://qcloudimg.tencent-cloud.cn/raw/a4d25e02c546e0878ba59fcda87f9c76.png) + + ### Step 3: Initialize TUIKit @@ -298,14 +189,13 @@ final CoreServicesImpl _coreInstance = TIMUIKitCore.getInstance(); _coreInstance.login(userID: userID, userSig: userSig); ``` -Note: Importing UserSig to your application is only for debugging purposes and cannot be used for the release version. Before publishing your app, you should generate your UserSig from your server. Refer to: +Note: Importing UserSig to your application is only for debugging purposes and cannot be used for the release version. Before publishing your app, you should generate your UserSig from your server. Refer to: [Generate Signature](https://trtc.io/document/34385?product=chat&menulabel=serverapis). ## Step 5. Implementing the conversation list page You can use the conversation (channel) list page as the homepage of your Chat module, which includes all conversations with users and groups that have chat records. -```markdown -![Conversation List Page](https://qcloudimg.tencent-cloud.cn/raw/a27b131d555b1158d150bd9b337c1d9d.png) + You can create a `Conversation` class, with `TIMUIKitConversation` as its body, to render the conversation list. You only need to provide the `onTapItem` callback, which allows users to navigate to the Chat page for each conversation. In the next step, we'll introduce the `Chat` class. @@ -345,8 +235,7 @@ class Conversation extends StatelessWidget { The chat page consists of the main message list and a message sending bar at the bottom. -```markdown -![Chat Page](https://qcloudimg.tencent-cloud.cn/raw/09b8b9b54fd0caa47069544343eba461.jpg) + You can create a `Chat` class, with `TIMUIKitChat` as its body, to render the chat page. We recommend providing an `onTapAvatar` callback function to navigate to the profile page for the current contact, which we'll introduce in the next step. @@ -385,8 +274,7 @@ class Chat extends StatelessWidget { This page shows the profile of a specific user and maintains the relationship between the current logged-in user and the other user. -```markdown -![User Profile Page](https://qcloudimg.tencent-cloud.cn/raw/03e88da6f1d63f688d2a8ee446da43ff.png) + You can create a `UserProfile` class, with `TIMUIKitProfile` as its body, to render the user profile page. @@ -424,42 +312,39 @@ Now your app can send and receive messages, display the conversation list, and m ## FAQs -### Do I need to integrate Chat SDK after integrating TUIKit? +#### Do I need to integrate Chat SDK after integrating TUIKit? No. You don't need to integrate Chat SDK again. If you want to use Chat SDK related APIs, you can get them via `TIMUIKitCore.getSDKInstance()`. This method is recommended to ensure Chat SDK version consistency. -### Why did force quit occur when I sent voice, image, file or other messages? +#### Why did force quit occur when I sent voice, image, file or other messages? Check whether you have enabled the **camera**, **mic**, **album**, or other related permissions. Refers to Step 1 above. -### What should I do if clicking Build And Run for an Android device triggers an error, stating no available device is found? +#### What should I do if clicking Build And Run for an Android device triggers an error, stating no available device is found? Check that the device is not occupied by other resources. Alternatively, click Build to generate an APK package, drag it to the simulator, and run it. -### What should I do if an error occurs during the first run for an iOS device? +#### What should I do if an error occurs during the first run for an iOS device? If an error occurs after the configuration, click **Product > Clean Build Folder** , clean the product, and run `pod install` or `flutter run` again. + -![](https://qcloudimg.tencent-cloud.cn/raw/d495b2e8be86dac4b430e8f46a15cef4.png) - -### What should I do if an error occurs during debugging on a real iOS device when I am wearing an Apple Watch? - -![](https://qcloudimg.tencent-cloud.cn/raw/1ffcfe39a18329c86849d7d3b34b9a0e.png) +#### What should I do if an error occurs during debugging on a real iOS device when I am wearing an Apple Watch? + Turn on Airplane Mode on your Apple Watch, and go to **Settings > Bluetooth** on your iPhone to turn off Bluetooth. Restart Xcode (if opened) and run `flutter run` again. -### What should I do when an error occurs on an Android device after TUIKit is imported into the application automatically generated by Flutter? - -![](https://qcloudimg.tencent-cloud.cn/raw/d95efdd4ae50f13f38f4c383ca755ae7.png) +#### What should I do when an error occurs on an Android device after TUIKit is imported into the application automatically generated by Flutter? + 1. Open `android\app\src\main\AndroidManifest.xml` and complete `xmlns:tools="http://schemas.android.com/tools" / android:label="@string/android_label" / tools:replace="android:label"` @@ -496,14 +381,3 @@ For those who require real-time voice and video call capabilities alongside our we highly recommend our dedicated voice and video call UI component package, [tencent\_calls\_uikit](https://pub.dev/packages/tencent_calls_uikit). This robust and feature-rich package is specifically designed to complement our existing solution and seamlessly integrate with it, providing a comprehensive, unified communication experience for your users. - -## Contact Us - -Please do not hesitate to contact us in the following place, if you have any further questions or -tend to learn more about the use cases. - -- Telegram Group: -- WhatsApp Group: -- QQ Group: 788910197, chat in Chinese - -Our Website: diff --git a/README_ZH.md b/README_ZH.md index dc39597..dc0c2fa 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -2,23 +2,12 @@ # Flutter TUIKit -TUIKit 是基于 IM SDK 实现的一套 UI 组件,其包含会话、聊天、搜索、关系链、群组、音视频通话等功能,基于 UI 组件您可以像搭积木一样快速搭建起自己的业务逻辑。 +TUIKit 是基于 Chat SDK 实现的一套 UI 组件,其包含会话、聊天、搜索、关系链、群组、音视频通话等功能,基于 UI 组件您可以像搭积木一样快速搭建起自己的业务逻辑。 -## 建议阅读文档目录 - -**快速使用本TUIKit组件库建议阅读:** - -- **[图文介绍各组件总览](https://cloud.tencent.com/document/product/269/70747)** -- **[快速集成本TUIKit至您的Flutter项目](https://cloud.tencent.com/document/product/269/70746)** - -集成更多高级功能建议阅读: - -- [集成本地搜索](https://cloud.tencent.com/document/product/269/79121) -- [集成离线推送](https://cloud.tencent.com/document/product/269/74605) -- [集成音视频通话](https://cloud.tencent.com/document/product/269/72485) - -## Widget +TUIKit 效果图如下所示: +![img](https://qcloudimg.tencent-cloud.cn/raw/f140dd76be01a65abfb7e6ba2bf50ed5.png) +TUIKit 主要 Widget 如下: - TIMUIKitConversation 会话组件 - TIMUIKitChat 聊天组件 - TIMUIKitCore Core 组件 @@ -30,15 +19,15 @@ TUIKit 是基于 IM SDK 实现的一套 UI 组件,其包含会话、聊天、 - TIMUIKitNewContact 新的联系人 - TIMUIKitSearch 搜索 -### 截图 - -![img](https://qcloudimg.tencent-cloud.cn/raw/f140dd76be01a65abfb7e6ba2bf50ed5.png) +快速使用 TUIKit 组件库建议阅读: +- [TUIKit 组件库](https://trtc.io/zh/document/50059?platform=flutter&product=chat) +- [集成 TUIKit](https://trtc.io/zh/document/58585?platform=flutter&product=chat&menulabel=uikit) ## 国际化 我们默认提供 `简体中文` `繁体中文` `英语` 的语言支持;并允许开发者新增语言包,扩展多语言支持。 -如果您需要使用国际化多语言能力,请参考 [腾讯云 IM Flutter TUIKit 国际化指南](https://docs.qq.com/doc/DSVN4aHVpZm1CSEhv?u=c927b5c7e9874f77b40b7549f3fffa57)。 +如果您需要使用国际化多语言能力,请参考 [Flutter TUIKit 国际化指南](https://docs.qq.com/doc/DSVN4aHVpZm1CSEhv?u=c927b5c7e9874f77b40b7549f3fffa57)。 ## TIMUIKitCore @@ -47,11 +36,11 @@ TUIKit 是基于 IM SDK 实现的一套 UI 组件,其包含会话、聊天、 `TIMUIKitCore`提供两个静态方法`getInstance` 和 `getSDKInstance`。 - `getInstance`: 返回 `CoreServicesImpl` 实例。 -- `getSDKInstance`: 返回 IM SDK 实例。 +- `getSDKInstance`: 返回 SDK 实例。 `CoreServicesImpl` 为`TIMUIKit` 核心类,包含初始化、登录、登出、获取用户信息等方法。 -基础用法如下,先初始化IM,再登录用户: +基础用法如下,先初始化 SDK,再登录用户: ```dart import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; @@ -82,13 +71,11 @@ _coreInstance.login( 通过`TIMCallbackType`确定类型。 -> 这部分的处理逻辑[可参考我们的 DEMO](https://github.com/TencentCloud/tc-chat-demo-flutter/lib/src/pages/app.dart),并根据您的需要,自行修改。 - #### SDK API 错误(`TIMCallbackType.API_ERROR`) 该场景下,提供 SDK API 原生`errorMsg`及`errorCode`。 -[错误码请参考该文档](https://cloud.tencent.com/document/product/269/1671) +[错误码请参考该文档](https://trtc.io/zh/document/34348?platform=flutter&product=chat&menulabel=uikit) #### Flutter 报错(`TIMCallbackType.FLUTTER_ERROR`) @@ -282,7 +269,7 @@ _coreInstance.login( `TIMUIKitSearch` 为全局搜索组件。全局搜索支持"联系人"/"群组"/"聊天记录"。 `TIMUIKitSearchMsgDetail` 为会话内搜索组件,可搜索会话内聊天记录。 -[详细用法可参考此文档](https://cloud.tencent.com/document/product/269/79121) +[详细用法可参考此文档](https://trtc.io/zh/document/50036?platform=flutter&product=chat&menulabel=uikit) ```dart import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart'; @@ -499,8 +486,8 @@ class _ChatV2State extends State { 基础组件可根据业务需要自行更换以及组合。如若需要控制业务层数据,可通过`TIMUIKitChatController`提供的方法。 +## 更多阅读 +集成更多高级功能建议阅读: -## 联系我们[](id:contact) -如果您在接入使用过程中有任何疑问,请加入 QQ 群:788910197 咨询。 - -![](https://qcloudimg.tencent-cloud.cn/raw/eacb194c77a76b5361b2ae983ae63260.png) +- [本地搜索](https://trtc.io/zh/document/50036?platform=flutter&product=chat&menulabel=uikit) +- [离线推送](https://trtc.io/zh/document/50032?platform=flutter&product=chat&menulabel=uikit)