In this document, the method to obtain UserSig is to configure a SECRETKEY in the client code. In this method, the SECRETKEY is vulnerable to decompilation and reverse engineering. Once your SECRETKEY is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is only suitable for locally running a demo project and feature debugging.
The correct UserSig distribution method is to integrate the calculation code of UserSig into your server and provide an app-oriented API. When UserSig is needed, your app can send a request to the business server to obtain a dynamic UserSig. For more information, see How to Generate UserSig on the Server.
4. Compile and Run the Demo
Import the demo project with Android Studio, and install the Flutter and Dart plugins.
Execute the following command in the project root directory to install dependencies, then compile and run.
flutter pub get
Platform Configuration
Web
To enable support for web, you need to perform the following extra steps in addition to those for enabling 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 run npm or yarn to install relevant JS dependencies. Initialize the project as instructed.
cd web
npm init
npm i @tencentcloud/chat
npm i tim-upload-plugin
Open web/index.html and import the JS files in <head> </head>. See below: