Links

Migrate from V1 to V2

V2 Android feature comparison with V1 Android feature

As RN SDK V2 upgrades Android SDK from V5 to V6, there are some differences in the features supported by V1 and V2 on the Android side. We made the feature comparison table below.
Features
V1 Android
V2 Android
Discover Feed
Channel Feed
Playlist Feed
Playlist Group Feed
Coming Soon
​Dynamic Content
Horizontal/Vertical/Grid Layouts
CTA button on Videos
CTA button click handler and listener
Shoppable Videos (Product Cards & Shopping experience
Feed item click listener
Video Player configurations
Share and Deep-link mechanism
Autoplay in Feed and its configuration
Livestream
IMA Ads
FWAI Ads
Storyblock
Picture in Picture(Outside App)
Picture in Picture(Inside App)
Multihost Livestream(Agora)
Low Latency Livestream
Retail Media Network (RMN) Ad support
Interstitial Ima Ad support
Interstitial FWAI Ad support
App-level setting
Coming Soon
The above table is last updated on June 8, 2023.

Migration steps

Update package version

Update the version of react-native-firework-sdk from 1.x.x to 2.x.x.

Update the Android project setting

As RN SDK V2 upgrades Android SDK from V5 to V6, please follow this guide to set up the Android project.
The main changes are:
  • The min kotlin version is: 1.6.10
  • Add mavenCentral() to build.gradle
  • V2 doesn't require adding maven { url "https://jitpack.io" } to build.gradle. You could remove maven { url "https://jitpack.io" } if no other library requires this.
  • We don’t require the Gradle plugin version. But we suggest using 4.2+ for V2(We suggest using 4+ for V1).
  • Update app/firework.gradle to:
    android {
    packagingOptions {
    exclude 'META-INF/annotation.kotlin_module'
    exclude 'META-INF/lifecycle-viewmodel_release.kotlin_module'
    exclude 'META-INF/annotation-experimental_release.kotlin_module'
    exclude 'META-INF/kotlin-stdlib.kotlin_module'
    }
    }

Initialize SDK

If you pass the user id to the SDK V1 init method, you need to follow V2 usage instead of V1 usage.
// V1 usage
FireworkSDK.getInstance().init('the user id of the host app');
// V2 usage
FireworkSDK.getInstance().init({
userId: 'the user id of the host app',
});
if you don't pass the user id to the SDK V1 init method, you don't need to make changes.

Configure video launch behavior

You need to follow V2 usage instead of V1 usage to configure video launch behavior.
// V1 usage
<VideoFeed
source="discover"
mode="row"
videoPlayerConfiguration={{ 'launchBehavior': 'muteOnFirstLaunch' }}
/>
// V2 usage
FireworkSDK.getInstance().init({
videoLaunchBehavior: 'muteOnFirstLaunch',
});

Configure the shopping CTA style through JS codes(Only supported on iOS)

You need to follow V2 usage instead of V1 usage to configure the shopping CTA style through JS codes on the iOS side.
// V1 usage
FireworkSDK.getInstance().shopping.onWillDisplayProduct = async (_) => {
return {
addToCartButton: {
backgroundColor: '#c0c0c0',
textColor: '#ffffff',
fontSize: 16,
},
};
};
// V2 usage
FireworkSDK.getInstance().shopping.productInfoViewConfiguration = {
ctaButton: {
backgroundColor: '#c0c0c0',
textColor: '#ffffff',
fontSize: 16,
},
};
Last modified 10h ago