Customize click behaviors (Flutter)
The SDK provides behavior callbacks to customize click behaviors, including those for the video CTA button, product cards, and shopping CTA button.
Customize video overlay CTA button click behavior
Set FireworkSDK.getInstance().onCustomCTAClick
to customize video overlay CTA button click behavior. The event type is CustomCTAClickEvent.
Customize product card click behavior
Set FireworkSDK.getInstance().shopping.onCustomTapProductCard
to customize product card click behavior. The event type is CustomTapProductCardEvent.
Customize shopping CTA click behavior
Set FireworkSDK.getInstance().shopping.onShoppingCTA
to customize shopping CTA click behavior. The event type is ShoppingCTAEvent. And host app can return a ShoppingCTAResult object to tell FireworkSDK the result.
Customize product link button click behavior
Set FireworkSDK.getInstance().shopping.onCustomClickLinkButton
to customize product link button click behavior. The event type is CustomClickLinkButtonEvent.
Customize cart icon click behavior
Set FireworkSDK.getInstance().shopping.onCustomClickCartIcon
to customize cart icon click behavior. The event type is CustomClickCartIconEvent.
Customize livestream link interaction click behavior
Set FireworkSDK.getInstance().liveStream.onCustomLinkInteractionClick to customize livestream link interaction click behavior. The event type is CustomLinkInteractionClickEvent.
Navigate to the host app page
Typically, we need to navigate to the host app page when customizing click behaviors. However, the Flutter navigation stack may be obscured by the Firework full-screen player. When the host app navigates to a new Flutter page (for instance, using Navigator.of(context).pushNamed
) within the Flutter navigation stack when customizing click behaviors, it will be obscured by the Firework full-screen player.
As illustrated in the following code snippets, you can invoke our APIs to convert the Firework full-screen player (if it exists) into a floating player or close it when customizing click behaviors. This approach ensures that the new Flutter page will not be obscured by the Firework full-screen player.
The above code snippets are based on onCustomTapProductCard
. But they are also applicable to other behavior callbacks.
Last updated
Was this helpful?