Shoppable Videos (iOS)
FireworkVideoSDK contains a shopping
property that enables video shopping integration. There are two main points of integration both located on the FireworkVideoShopping
type.
FireworkVideoShoppingDelegate
Assign a FireworkVideoShoppingDelegate
to receive important shopping events.
The shopping lifecycle events provide opportinities to customize the product views, hydrate product information and handle when a user adds a product variant to the cart.
Shopping View Configuration
When the fireworkShopping(_:willDisplayProductInfo:forVideo:)
method is called it gives the host app a chance to configure the view that will be displayed. Similar to how view configurations work on the VideoFeedViewController
the properties are value types and must be reassigned to the configurator
before the changes will be applied.
The following items can be configured:
Shopping Cart icon
isHidden - Important: When setting this value to
false
ensure thecartProvider
is added.indicator - (Used to indicate to the user that there is an item in their cart)
isHidden - if the indicator is hidden or not
CTA Button
Button color
Button font
Button text color
Button Label - Shop Now or Add to Cart
Unavailable text
Product card
Appearance mode
Hide Price
Corner Radius
Product card CTA Button text
Hide product card CTA Button
For more detailed examples see the Sample App Code.
Product Hydration
The fireworkShopping(_:updateDetailsForProducts:forVideo:_:)
method will be called when a video will be shown that contains products. It is at this point when the host app will be able to update the associated product information. In fireworkShopping(_:updateDetailsForProducts:forVideo:_:)
, you could use ProductHydrating
API to hydrate products. For example, you could update product names, descriptions, and variants.
Strategy for hydrating product variants
With
merge
strategy, we will merge these new variants into existing variants. We use variant id to match the variant.With
replace
strategy, we will replace existing variants with these new variants.
Handle primary product CTA button
The fireworkShopping(_:productVariantCTASelected:fromVideo:_:)
method is called when the user has selected the CTA Button ("Add to cart"/"Shop now") and will pass the ids of the product and variant of the selected item.
The host app must call the ctaCompletionHandler
to inform the next action to perform.
showEmbeddedCart
- When sepecifying this action the SDK will request aCartViewController
from theFireworkVideoSDK.shopping.cartProvider
; see Providing an embedded cart view for more details.dismissWithFeedback
- When specifying this action the SDK will dismiss the Product summary drawer and display a toast message to the user.feedbackOnly
- When specifying this action the SDK will only display a toast message to the user.none
- When specifying this option the SDK won't perform any action.
Note: If no action is provided within 2 seconds the SDK will assume the item was not successfully added.
Important: it is at this point when the host app should add the item to the user's cart as they have indicated intent to buy this product.
Providing an embedded cart view
The host app can embed their own custom cart view which will be displayed directly within the Firework Video Player. This custom cart view can be shown within the Firework Video Player after the following actions occur:
User clicks cart icon - The host app must setup the configuration to show a shopping icon; see Shopping View Configuration for more details.
Host app returns
showEmbeddedCart
as theAddToCartAction
- This is sequence occurs after the user selects "Add to cart".
The host app must supply a mechanism that conforms to CartViewProviding
in order to provide a CartViewController
. A provider must be assigned on the FireworkVideoSDK.shopping.cartProvider
property. If no provider is set the actions above will be replaced with these actions; respectively:
User clicks cart icon - Nothing.
Host app returns
showEmbeddedCart
as theAddToCartAction
- SDK treats this as a success and will use thedismissWithFeedback
withsuccess
.
The CartViewController
has a drawerController: DrawerControllerRepresentable
property which provides a func to close the cart view container.
Handle product link button
The default action of the product link button is to open the product URL in a web view. By default, this button would be visible, but this button can be hidden if required within the event callback of the FireworkVideoShoppingDelegate
Callback event for product link button click
Callback event for product card click
Handle cart icon
Purchase tracking
The host app can record a purchase which will help get a full picture of the user journey flow.In order to do this, call FireworkVideoSDK.trackPurchase
whenever the purchase happens.
Last updated