Shopping (React Native)

Shopping configurations

Please refer to Shopping configurations (React Native).

Customize shopping click behaviors

Please refer to Customize shopping click behaviors.

Product Hydration

Host app can implement onUpdateProductDetails callback to update product info in the client side, such as product name. We call this product hydration. For example, the host apps could fetch the latest product information from their own servers on the callback and return the lastest product info in the callback. The code snippets are:

FireworkSDK.getInstance().shopping.onUpdateProductDetails = async (event) => {
  let products: Product[] = []
  for (let productId of event.productIds) {
    let product: Product = { productId: productId };
    // The latest product information can be fetched from the servers of the host app.
    product.name = 'latest-product-name';
    product.description = 'latest-product-description';
    products.push(product);
  }

  return products;
};

Reference

VideoShopping

Last updated

Was this helpful?