tencent cloud

Chat

News and Announcements
Release Notes
Announcements
Product Introduction
Overview
Basic Concepts
Scenarios
Features
Account System
User Profile and Relationship Chain
Message Management
Group Related
Official Account
Audio/Video Call
Use Limits
Purchase Guide
Billing Overview
Pricing
Purchase Instructions
Renewal Guide
Service Suspension Explanation
Refund Policy
Development Guidelines
Demo Zone
Activate Service
Free Demos
Quick Run
Download
SDK and Demo Source Code
Update Log
Chat Interaction (UI Included)
TUIKit Introduction
Getting Started
Full-feature Integration
Single-function Integration
Build with AI
Build Basic Interfaces
More Features
Customizing Appearance
Internationalization
Push Service
Overview
Noun explanation
Activate the Service
Quick Start
Manufacturer Channel
Statistics
Troubleshooting Tool
Client APIs
REST API
Push Callback
Advanced Features
Release Notes
Error Codes
FAQS
Desk
Overview
Quick Start
Integration Guide
Admin Operation Manual
Agent Manual
More Practices
Live Streaming Setup Guide
AI Chatbot
Super Large Entertainment and Collaboration Community
Discord Implementation Guide
How to Integrate Chat into Games
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
No UI Integration
Quick Start
SDK Integration
Initialization
Login and Logout
Message
Conversation
Group
Community Topic
User Profile and Relationship Chain
Offline Push
Cloud Search
Local Search
Official Channel Management
Client APIs
JavaScript
Android
iOS & macOS
Swift
Flutter
Electron
Unity
React Native
C APIs
C++
Server APIs
Secure authentication with UserSig
RESTful APIs
Webhooks
Console Guide
New Console Introduction
Creating and Upgrading an Application
Basic Configuration
Feature Configuration
Account Management
Group Management
Official Channel Management
Webhook Configuration
Usage
Viewing Guide for Resource Packages
Real-Time Monitor
Auxiliary Development Tools
Access Management
Advanced Features
FAQs
uni-app FAQs
Purchase
SDK
Account Authentication
User Profile and Relationship Chain
Message
Group
Audio-Video Group
Nickname and Profile Photo
Security Compliance Certification
Service Level Agreement
Security Compliance Certification
Chat Policies
Privacy Policy
Data Privacy and Security Agreement
Migration
Migration Solutions
Migration Solutions Lite
Error Codes
Contact Us

Flutter

PDF
Focus Mode
Font Size
Last updated: 2026-03-03 14:24:42
This document will guide you through integrating TUIKit and successfully sending your first message.
Or, if you prefer a faster and more automated approach, you can refer to Get started with AI integration to streamline the process.

Prerequisites

Flutter >= 3.29.0, Dart >= 3.7.0, Kotlin >= 1.9.
Android Studio Ladybug | 2024.2.1 or later, Android Gradle plugin 7.3.1 or later, JDK 17.
Xcode 12.0 or later.

Create Application

Before you integrate TUIKit, you need to create a new Chat application in the console. Follow these steps:
1. Register for a Tencent RTC account and add a payment method.
2. Log in to the Chat Console, then click Create Application.



3. In the pop-up window, enter the application name, select Chat, choose the appropriate Deployment Region, and click Create.



4. After the application is created, you can get your SDKAppID and SDKSecretKey.



Note:
Newly created applications default to the Trial Edition business version and are enabled by default.
Each account can create up to 300 Chat applications. If you reach this limit, you can disable and delete unused applications before creating new ones. Once deleted, all data and services associated with the SDKAppID are permanently lost and cannot be recovered. Proceed with caution.

Create Account

Creating an application allows you to initialize the SDK, but to send messages, you must create user accounts within the application. You can create accounts directly in the console or register them via API on the client side. Choose the method that best fits your workflow.
Note:
You need at least two users to send messages, so create at least two accounts now. Record the userIDs for both accounts, as you will need them in later steps.
Option A: Create in Console
Note:
For more account management options, see Account Management.
1. Log in to the Chat Console, select Chat > Users from the left navigation bar, and select your target application at the top.
2. On the account management page, click Create Account.
3. In the dialog, configure the following parameters:



Account Type: Choose between regular accounts and administrator accounts. "App Administrator" has the highest management privileges and can use REST APIs to create/disband groups, send All Users Push messages, and more. Each application supports up to 10 administrators.
Username: Enter the username (UserID). This field is required.
User Nickname: Optionally enter a nickname.
Avatar: Optionally enter an avatar URL.
4. Click OK to save the account.
5. After creation, you can view the username, nickname, account type, avatar, and creation time in the account list.
Option B: Create accounts upon logging in
To register an account on the client side, simply pass a new UserID when logging in to TUIKit as described below. TUIKit will automatically register the UserID for you—no extra steps required.

Generate UserSig

Note:
For more information about UserSig, see UserSig Generation & Verification.
2. In the UserSig tool, select your application and enter the UserID.
3. Click Generate to create the signature. The default validity period is 180 days.
4. Click Copy Signature (UserSig) to copy and save the signature.




Integrate TUIKit

Message sending in chat is handled by MessageList. For integration details, refer to the Full Feature Integration documentation.

Log in to TUIKit

All TUIKit features require user login, which is provided by the LoginStore login interface:
final result = await LoginStore.shared.login(
sdkAppID: SDKAPPID,
userID: userID,
userSig: userSig,
);
if (result.errorCode == 0) {
This interface requires three parameters:
SDKAppID: The SDKAppID for your application, obtained in the Create Application section.
UserID: The UserID for User1, obtained in the Create Account section. Note: This is not the user's nickname.
UserSig: The UserSig for User1, obtained in the Generate UserSig section.

Navigate to Chat Interface

To send messages, follow these steps:

1. Log in to TUIKit using one of the registered accounts (referred to as user1). Once logged in, user1 is online.
2. user1 sends a message to another account (referred to as user2). user2 does not need to be logged in and does not need to be friends with user1.
Note:
This section describes how user1 can send a message to user2 after logging in as user1. If you want user1 and user2 to chat interactively, log in as user2 using the same steps and enter the chat interface with user1.
After user1 logs in successfully, you can navigate to or embed the chat interface and send a message to user2.
Use the following example code. Set userID to the userID of the chat target (user2):
final conversation = ConversationInfo(
conversationID: 'c2c_${userID}',
type: ConversationType.c2c,
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChatPage(
conversation: conversation,
),
),
);

Send Your First Message

After completing the steps above, you can access the chat interface. Click the input box and send your first message:




Contact Us

If you have any questions about this documentation, join the Telegram Technical Group for technical support.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback