All Products
Search
Document Center

ApsaraVideo Live:SDK integration

Last Updated:Apr 15, 2025

This topic describes how to integrate Push SDK for Flutter.

Prerequisites

Android Studio or Visual Studio Code is installed.

Environment requirements

Item

Requirement

Flutter version

Versions from 2.8.0 to 3.27.0, with 2.8.0 recommended

Dart version

Versions from 2.15.0 to 3.6.0

System version

  • Android 5.0 or later

  • iOS 10.0 or later

CPU architecture

armeabi-v7a or arm64-v8a

Development tool

Android Studio or Visual Studio Code

Procedure

  1. Integrate the SDK.

    Choose one of the following methods:

    Add dependency

    Add the following dependency to the pubspec.yaml file of your local project:

    dependencies:
      flutter_livepush_plugin: ^x.y.z
    Note

    Replace x.y.z with the actual version number of the Push SDK, such as 7.1.0. For the latest version, see Sdk download.

    Use command-line tool

    flutter pub add flutter_livepush_plugin

    This command automatically updates your pubspec.yaml file.

    Local Integration

    Create a plugins directory in your project and place the SDK in this directory. Then, add the following dependency to the pubspec.yaml file:

    flutter_livepush_plugin:
        path: "./plugins/flutter_livepush_plugin" // SDK storage path
    Note

    For latest SDK version, see Sdk download.

  2. Run the following command to install the dependency.

    flutter pub get
  3. Add relevant system permission statements. 

    Android

    Open the ./android/app/src/main/AndroidManifest.xml file and declare the required permissions. 

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

    iOS

    Add the configurations that authorize access to the camera and microphone to the Info.plist file of the project. 

    <key>NSCameraUsageDescription</key>
    <string>Authorize access to the camera for video streaming</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Authorize access to the microphone for audio streaming</string>
  4. Configure other project settings. 

    In Android, add the following rules to the obfuscation rule file.

    Note

    If obfuscation is enabled for your application, you must configure obfuscation rules. Otherwise, a crash occurs when you use Push SDK. For the latest obfuscation configuration, see the source code of the demo. 

    -keep class org.webrtc.** { *; }
    -keep class com.alivc.** { *; }
    -keep class com.aliyun.** { *; }
    -keep class com.cicada.** { *; }
  5. Configure a license.

    For information about how to integrate a license, see Integrate a Push SDK license.

References