• UIKit
  • SDK
  • 서버 API
Chat/
SDK/
Flutter/
Chat SDK 설치/
SDK
  • Chat SDK 설치
    • 설치
  • Chat SDK 초기화
    • 초기화
  • 로그인 및 로그아웃
    • 로그인 및 로그아웃
  • 메시지
    • 메시지 개요
    • 메시지 보내기
    • 메시지 받기
    • 과거 메시지
    • 메시지 전달
    • 메시지 수정
    • 메시지 삽입
    • 메시지 삭제
    • 메시지 비우기
    • 메시지 철회
    • 온라인 메시지
    • 읽음 확인
    • 메시지 조회
    • 그룹 @ 메시지
    • 지향적 그룹 메시지
    • 알림 음소거
    • 메시지 확장
  • 대화
    • 대화 개요
    • 대화 목록
    • 대화 획득
    • 읽지 않은 대화 수
    • 대화 최상단 고정
    • 대화 삭제
    • 대화 초안
    • 대화 그룹
  • 그룹
    • 그룹 개요
    • 그룹 관리
    • 그룹 정보
    • 그룹 멤버 관리
    • 그룹 멤버 정보
    • 그룹 속성 사용자 정의
  • 사용자
    • 사용자 정보
    • 친구 관리
    • 친구 목록
    • 블록리스트
  • 오프라인 푸시
    • 오프라인 푸시
  • 시그널링
    • 시그널링 관리
  • 국부 검색
    • 메시지 검색
    • 친구 검색
    • 그룹 검색
    • 그룹 멤버 검색
  • 인터페이스 참고 문서
    • 고객 인터페이스
  • Guideline for Beginners
  • 콘솔 안내
    • 애플리케이션 생성 및 업그레이드
    • 기본 구성
    • 기능 구성
    • 계정 관리
    • 그룹 관리
    • 콜백 구성
  • 제품 소개
    • 메시지 관리
      • 1대1 메시지
      • 메시지 저장
      • 오프라인 푸시
      • 그룹 메시지
      • 메시지 포맷
    • 계정 시스템
      • 로그인 인증
      • 온라인 상태 관리
    • 그룹 관련
      • 그룹 시스템
      • 그룹 관리
    • 사용자 정보 및 관계망
      • 정보 관리
      • 관계망 관리
  • 구매 가이드
    • 과금 개요
    • 가격
  • 에러코드
이 페이지는 현재 영어로만 제공되며 한국어 버전은 곧 제공될 예정입니다. 기다려 주셔서 감사드립니다.

설치

This document describes how to quickly integrate the Tencent Cloud Chat SDK into your Flutter project.

Environment Requirements

Platform
Version
Flutter
2.2.0 or later
Android
Android Studio 3.5 or later; devices with Android 4.1 or later for apps
iOS
Xcode 11.0 or later. For testing with a real device, ensure that your project has a valid developer signature.

Supported Platforms

We are committed to building a set of Chat SDK and TUIKit for all Flutter platforms, allowing you to run one set of code across all platforms.
Platform
Support or Not
iOS
Supported
Android
Supported
Supported from v4.1.1+2
Supported from v4.1.9
Supported from v4.1.9
Hybrid development (Adding SDK for Flutter to existing native applications)
Supported from v5.0.0
Note:
For web, macOS, and Windows platforms, you need to perform a few extra steps for SDK integration. For details, see Support for the Flutter for Web and Support for the Flutter for Desktop in this document.

Trying Out Demos

Before integration, you can try out our demos to quickly understand the capabilities of the Tencent Cloud Chat cross-platform SDK and TUIKit for Flutter.
All of the following demos are packaged by the same Flutter project. The Chat SDK for Flutter already supports desktop platforms (macOS/Windows), and the corresponding demo will be available soon.
Mobile App
Web - HTML5
iOS/Android app (automatically downloaded according to your platform)![](https://qcloudimg.tencent-cloud.cn/raw/ca2aaff551410c74fce48008c771b9f6.png)
Scan the QR code with your mobile phone to try out![](https://qcloudimg.tencent-cloud.cn/raw/3c79e8bb16dd0eeab35e894a690e0444.png)


Integrating the Chat SDK

You can directly integrate the Chat SDK for Flutter through pub add, or write the Chat SDK into pubspec.yaml.

Installing the Chat SDK via flutter pub add

Enter the following command in the terminal window (the Flutter environment is ready):
flutter pub add tencent_cloud_chat_sdk
Note:
If your project also needs to be applied to web or desktop (macOS/Windows) platforms, you need to perform a few extra steps for SDK integration. For details, see Support for the Flutter for Web and Support for the Flutter for Desktop in this document.

Writing the Chat SDK into pubspec.yaml

dependencies:
tencent_cloud_chat_sdk: "Latest version" // You can check the latest version of the Chat SDK for Flutter on https://pub.dev/packages/tencent_cloud_chat_sdk
Here, your editor may automatically run flutter pub get. If not, enter the command flutter pub get.
If your project requires web support, import JS files by referring to the web compatibility description section before performing subsequent steps.

Support for the Flutter for Web

Chat SDK (tencent_cloud_chat_sdk) 4.1.1+2 or later provides full compatibility with web.
To enable support for web, you need to perform the following extra steps, compared with the steps to enable support for Android and iOS:

Upgrading to Flutter 3.x

Flutter 3.x has been dramatically optimized for web performance and is highly recommended for Flutter web project development.

Importing JS

Note:
If your existing Flutter project does not support web, run flutter create . in the root directory of the project to add web support.
Go to the web/ directory of your project and use npm or Yarn to install related JS dependencies. To initialize the project, follow the on-screen instructions.
cd web

npm init

npm i tim-js-sdk

npm i tim-upload-plugin
Open web/index.html and import the JS files in <head> </head>. See below:
<script src="./node_modules/tim-upload-plugin/index.js"></script>
<script src="./node_modules/tim-js-sdk/tim-js-friendship.js"></script>




Importing the Flutter for Web supplement SDK

flutter pub add tencent_im_sdk_plugin_web

Support for the Flutter for Desktop (PC)

Our no-UI SDK (tencent_cloud_chat_sdk) v4.1.9 or later provides full compatibility with macOS and Windows clients.
To enable support for macOS and Windows, you need to perform the following extra steps, compared with the steps to enable support for Android and iOS:

Upgrading to Flutter 3.x

Only Flutter 3.0 or later supports desktop clients. Therefore, if you need to use desktop clients, upgrade your Flutter to Flutter 3.x.

Importing the Flutter for Desktop supplement SDK

flutter pub add tencent_im_sdk_plugin_desktop

Modifying macOS configuration

Open the macos/Runner/DebugProfile.entitlements file.
In <dict></dict>, add the following key-value pair:
<key>com.apple.security.app-sandbox</key>
<false/>

FAQs

What should I do if flutter pub get/add fails?

Configure Flutter to use a mirror site as instructed in Flutter.