Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 3.78 KB

File metadata and controls

84 lines (59 loc) · 3.78 KB

TRTC Flutter API-Example

中文 | English

Background

This open-source demo shows how to use some APIs of the TRTC Flutter SDK to help you better understand the APIs and use them to implement some basic TRTC features.

Contents

This demo covers the following features (click to view the details of a feature):

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.

Demo Run Example

Prerequisites

You have signed up for a Tencent Cloud account and completed identity verification.

Obtaining SDKAPPID and SDKSECRETKEY

  1. Log in to the TRTC console and select Application Management > Create application.
  2. Click Create Application and enter the application name such as APIExample. If you have already created an application, click Select Existing Application. #900px
  3. Click Next to view your SDKAppID and key.

Configuring demo project files

  1. Find and open /lib/Debug/GenerateTestUserSig.dart.
  2. Set parameters in GenerateTestUserSig.dart as follows.
  • SDKAPPID: a placeholder by default. Set it to the actual SDKAppID.
  • SDKSECRETKEY: a placeholder by default. Set it to the actual key. #900px
  1. Click Next to complete the creation.
  2. After compilation, click Return to Overview Page.

!The method for generating UserSig described in this document involves configuring SDKSECRETKEY in client code. In this method, SDKSECRETKEY may be easily decompiled and reversed, and if your key is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is suitable only for the local execution and debugging of the demo.

The correct UserSig distribution method is to integrate the calculation code of UserSig into your server and provide an application-oriented API. When UserSig is needed, your application can make a request to the business server for dynamic UserSig. For more information, please see How to Calculate UserSig.

Compiling and running the project

  1. Run flutter pub get.
  2. Compile, run, and debug the project.

Android

  1. Run flutter run.
  2. Open the demo project with Android Studio (3.5 or above), and click Run.

iOS

  1. Run pod install.
  2. Open the /ios demo project in the source code directory with Xcode (11.0 or above) and compile and run the demo project.