The Flutter Push SDK is a stream ingest tool built on the native layer of the Android and iOS Push SDKs. This topic describes how to compile the demo.
Download the demo
For the latest demo source code and installation package, see SDK download.
Compile the demo
Environment requirements
|
Category |
Requirement |
|
Flutter version |
Version 2.5.0 or later, but earlier than 3.0.0. Version 2.8.0 is recommended. |
|
Dart version |
Version 2.12.0 or later, but earlier than 3.0.0. |
|
System Version |
|
|
CPU architecture |
armeabi-v7a or arm64-v8a. |
|
Development tools |
Use Android Studio or Visual Studio Code. |
Compilation
IDE method
Android Studio
-
Open the project:
Open Android Studio, click Open, select the flutter_livepush_plugin project, and open the example folder.
-
Install dependencies:
In Android Studio, open the
pubspec.yamlfile and click thePub Getbutton in the upper-right corner to install dependencies. -
Set up a device:
Make sure an Android physical device is connected.
-
Run the app:
Click the green run button (
Run) in the toolbar and select your target device to launch the app.
Visual Studio Code
-
Open the project:
Launch Visual Studio Code. Choose
File -> Open Folder, select the flutter_livepush_plugin project, and open the example folder. -
Install dependencies:
In this folder, open a command line and run the following command to install dependencies.
flutter pub get -
Set up a device:
Make sure an Android or iOS physical device is connected. Use the device selector in the bottom-left corner of VS Code to choose your target device.
-
Run the app:
Press
F5or click theRun and Debugicon in the activity bar on the left, select theFlutterconfiguration, and start a debug session.
Xcode (iOS)
-
Open the project:
Select the flutter_livepush_plugin project and open the ios folder inside the example directory.
-
Install CocoaPods dependencies:
In the ios folder inside the example directory, open a command line and run the following command.
pod install -
Configure signing:
In Xcode, select the
Runnerproject, go to theSigning & Capabilitiestab, and configure a valid developer account and signing certificate. -
Run the app:
Click the run button (
▶️) in the Xcode toolbar and select your target device to launch the app.
Command-line method
Go to the example directory (flutter_livepush_plugin > example) and open a command line.
-
Install dependencies.
flutter pub get -
Compile the project.
Android
ImportantBefore compiling the Android project, make sure you have installed the Android SDK and Gradle.
-
Run the app:
Run the following commands to launch the app.
# Run the debug build flutter run --debug # Run the release build flutter run --release -
Package an APK file:
Run the following command to generate an APK file.
flutter build apkNoteThe APK file is located at
build/app/outputs/flutter-apk/app-release.apk.
iOS
ImportantBefore compiling the iOS project, make sure you have installed Xcode and CocoaPods.
First, initialize CocoaPods dependencies:
cd ios && pod install && cd ..-
Run the app:
Run the following commands to launch the app.
# Run the debug build flutter run --debug # Run the release build flutter run --release -
Package an IPA file:
Run the following command to generate an IPA file.
flutter build ipaNoteThe IPA file is located at
build/ios/ipa/Runner.ipa.
-
FAQ
Other compilation issues
Check that your Flutter version meets the environment requirements.
How to obtain an ingest URL
To obtain an ingest URL, see Generate streaming URLs.
Stream ingest fails in the demo
Use self-service troubleshooting to test your ingest URL and verify that it is valid.
How to view information about ingested audio and video streams
Go to Stream management. Under Active streams, you can view and manage ingested audio and video streams.
How to play back a stream
After starting stream ingest, use a player such as ApsaraVideo Player, FFplay, or VLC to test stream pulling. To obtain a playback URL, see Generate streaming URLs.