As follows, you could set FireworkSDK.getInstance().liveStream.onLiveStreamChatEvent to receive live stream chat events. The event type is LiveStreamChatEvent.
Product click events
Outstream PDP
If you would like to customize the product click event handling, you could use onCustomTapProductCard to support this use case. For example, you could open your product detail page when the user clicks on the product. We call this outstream PDP.
Instream PDP
If you would like to use the SDK default behavior to handle the product click event, you could use onClickProduct to support this use case. The SDK default behavior is opening Firework product detail page when the user clicks on the product. We call this instream PDP.
Shopping CTA click events
You could use onShoppingCTA callback to receive shopping CTA click events.
Video overlay CTA click events
If you would like to customize the overlay CTA click event handling, you could use onCustomCTAClick to receive video overlay CTA click events. For example, you could open your product detail page when the user clicks on the overlay CTA.
If you would like to use the SDK default behavior to handle the overlay CTA click event, you could use onVideoPlayback(eventName is VideoPlaybackEventName.ClickCTA) to receive video overlay CTA click events. The SDK default behavior is opening the CTA link using the SDK webview or system browser when the user clicks the overlay CTA.
Purchase tracking
The host app can record a purchase which will help get a full picture of the user journey flow. To do this, call FireworkSDK.getInstance().trackPurchase whenever the purchase happens. The following are the sample codes:
Conversion tracking
Get feed id for VideoFeed and StoryBlock during component initialization
You could use onVideoFeedGetFeedId callback to get feed id for VideoFeed and StoryBlock during component initialization. The related reference links are:
FireworkSDK.getInstance().trackPurchase({
orderId: '<Order ID of User Purchase>',
value: 'total purchase value',
currencyCode: 'e.g. USD',
countryCode: 'e.g. US',
additionalInfo: {
additionalKey1: 'additionalValue1',
additionalKey2: 'additionalValue2',
additionalKey3: 'additionalValue3',
},
});
<VideoFeed
style={{ height: 200 }}
source="discover"
onVideoFeedGetFeedId={(feedId) => {
// The host app could store some custom info based on the feed id,
// such as component name
}}
/>
<StoryBlock
style={{ height: 200 }}
source="discover"
onStoryBlockGetFeedId={(feedId) => {
// The host app could store some custom info based on the feed id,
// such as component name
}}
/>
FireworkSDK.getInstance().shopping.onShoppingCTA = async (event: ShoppingCTAEvent) => {
const feedId = event.video.feedId;
if (feedId) {
// Get custom info based on the feed id
}
}
FireworkSDK.getInstance().shopping.onCustomClickCartIcon = async (event) => {
const feedId = event.video.feedId;
if (feedId) {
// Get custom info based on the feed id
}
};
FireworkSDK.getInstance().shopping.onUpdateProductDetails = async (event) => {
const feedId = event.video.feedId;
if (feedId) {
// Get custom info based on the feed id
}
};
FireworkSDK.getInstance().shopping.onCustomTapProductCard = async (event) => {
const feedId = event.video.feedId;
if (feedId) {
// Get custom info based on the feed id
}
};
FireworkSDK.getInstance().onCustomCTAClick = async (event) => {
const feedId = event.video.feedId;
if (feedId) {
// Get custom info based on the feed id
}
}