Getting Started
- Firework App Id
- Flutter SDK >=3.0.0
- Dart SDK >=2.17.0
- iOS project
- iOS 12 or greater.
- Xcode 14 or greater.
- Swift 5.7 or greater.
- Android Project
- JAVA_HOME 1.8 or greater
- minSdkVersion 21 or greater
- compileSdkVersion 31 or greater
- targetSdkVersion 31 or greater
- kotlinVersion 1.6.10 or greater
Installing Firework Flutter SDK requires the following step:
- 1.Install Flutter plugin package
- 2.Setup Native project
flutter pub add fw_flutter_sdk
Run
pod install
in the root directory of the iOS project. And we also need to re-run pod install
when upgrading the Flutter SDK version.- build.gradle
buildscript {
repositories {
...
// This should be added
mavenCentral()
}
dependencies {
// We don’t require Gradle plugin version. Just an example.
classpath("com.android.tools.build:gradle:7.3.1")
...
}
}
allprojects {
repositories {
...
mavenCentral()
}
}
- gradle-wrapper.properties
...
# We don’t require Gradle version. Just an example.
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
...
- app/src/.../MainActivity.kt
The MainActivity should extend FlutterFragmentActivity.
class MainActivity: FlutterFragmentActivity()
- app/build.gradle
...
apply from: 'firework.gradle'
- add
android:windowSoftInputMode="adjustPan"
to the fileapp/src/Androidmanifest.xml
if there is a story block in your app and use the live stream
<application
android:name=".MainApplication"
...>
<activity
android:name=".MainActivity"
...
android:windowSoftInputMode="adjustPan">
</activity>
</application>
- New file: app/firework.gradle
android {
packagingOptions {
exclude 'META-INF/*.kotlin_module'
}
}
dependencies {
implementation "com.firework:sdk:+"
// Uncomment the next line if you want to integrate the single-host live stream
// implementation "com.firework.external.livestream:singleHostPlayer:+"
// Uncomment the next line if you want to integrate the multi-host live stream
// implementation "com.firework.external.livestream:multiHostPlayer:+"
}
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.firework' && details.requested.name == 'sdk') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
if (details.requested.group == 'com.firework.external.livestream' && details.requested.name == 'singleHostPlayer') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
if (details.requested.group == 'com.firework.external.livestream' && details.requested.name == 'multiHostPlayer') {
details.useVersion rootProject.ext.get("fwNativeVersion")
}
}
}
Include the app ID in your app
Info.plist
file using the key FireworkVideoAppID
.See the image below:

Include the
appid
in your app AndroidManifest.xml
file, like below: <application
...
>
<activity .../>
...
// Include the app ID
<meta-data
android:name="Firework:Appid"
android:value="your firework appid" />
</application>
import 'package:fw_flutter_sdk/fw_flutter_sdk.dart';
/// Optional: set listener for SDK init
FireworkSDK.getInstance().onSDKInit = (event) {
};
/// It is recommended to call the init method when the application starts,
/// e.g. in the initState method of your App State.
/// The init method supports passing userId and videoLaunchBehavior.
FireworkSDK.getInstance().init();
Last modified 1mo ago