Last updated: 2021-05-20 19:46:52

    This document describes how to quickly integrate TRTC SDK for Flutter into your project.

    Environment Requirements

    • Flutter 2.0or above
    • Developing for Android:
      • Android Studio 3.5 or above
      • Devices with Android 4.1 or above
    • Developing for iOS:
      • Xcode 11.0 or above
      • Your project has a valid developer signature.

    Integrating the SDK

    The SDK for Flutter has been published on Pub. You can have the SDK downloaded and updated automatically by configuring pubspec.yaml.

    1. Add the following dependency to pubspec.yaml of your project.
      dependencies:
      tencent_trtc_cloud: latest version number
    2. Grant camera and mic permissions to enable the audio and video call features.

    iOS

    1. Add requests for camera and mic permissions in Info.plist:
      <key>NSCameraUsageDescription</key>
      <string>Video calls are possible only with camera permission.</string>
      <key>NSMicrophoneUsageDescription</key>
      <string>Audio calls are possible only with mic permission.</string>
    2. Add the field io.flutter.embedded_views_preview and set the value to Yes.

    Android

    1. Open /android/app/src/main/AndroidManifest.xml.
    2. Add xmlns:tools="http://schemas.android.com/tools" to “manifest”.
    3. Add tools:replace="android:label" to “application”.
      说明:

      Without the above steps, the “Android Manifest merge failed” error will occur and the compilation will fail.

    Illustration

    FAQs