Firework for Developers
One-to-one Virtual ShoppingBusiness Portal
  • Welcome to Firework for Developers
  • Firework Interactive Video and One-to-many Digital Showroom
  • Web
    • Getting Started (Web)
      • Shopify
      • Magento
      • Wordpress (WooCommerce)
      • Salesforce Commerce Cloud
      • BigCommerce
    • Integration Guide for Web
      • Components
        • Hero Unit
        • Carousel / Grid
        • Storyblock (Web)
        • Player (Floating)
        • Storylink
      • Styling
      • Feed Attributes
      • Player
        • Configuration
          • Appearance
      • Video customization
        • Video Factory
        • CTA Button
        • Product cards
      • Events
        • Embed Feed and Storyblock Events
        • Video player events
        • Live stream events
        • Shopping events
      • Shopping Integration (V2)
        • Introduction
        • Shopping APIs
        • Product Hydration
        • Product Factory
        • Cart Sync
        • Tracking
          • Purchase
          • Add to cart
          • Remove from cart
          • Page viewed
        • Shopping Integration FAQ
        • Migrate from V1
      • Web SDK
      • Enhanced Picture-in-Picture
      • Privacy settings
        • Tracking settings
        • Cookies management
        • Content Security Policy
    • Telemetry console
    • Firework Service Domains
    • FAQ & Troubleshooting (Web)
  • Android SDK
    • Integration Guide for Android SDK
      • Getting Started (Android)
      • Video Feed (Android)
        • Video Feed Layouts (Android)
        • Channel Feed (Android)
        • Discover Feed (Android)
        • Playlist Feed (Android)
        • Dynamic Content Feed
        • Channel Hashtags Feed
        • Sku Feed
        • Single Content Feed
        • Configure Video Feed
      • Customization
        • CTA
      • Analytics (Android)
      • Shoppable Videos (Android)
        • Product Hydration
      • Live Stream Support (Android)
      • Video Player (Android)
      • StoryBlock (Android)
      • Share & Video Deep linking
      • Ad Support (Android)
      • Configure Video Advertisements Source (Android)
      • In-app Language Switches
      • Compose support(Android)
    • Sample App (Android)
    • FAQ & Troubleshooting (Android)
    • Changelog (Android)
  • iOS SDK
    • Integration Guide for iOS SDK
      • Getting Started (iOS)
      • ATT compliance (iOS)
      • Video Feed (iOS)
        • Discover Feed(iOS)
        • Channel Feed (iOS)
        • Playlist Feed (iOS)
        • Playlist Group Feed (iOS)
        • Dynamic Content (iOS)
        • Hashtag Playlist (iOS)
        • SKU Playlist (iOS)
        • Video Ads (iOS)
        • Video Feed Layouts (iOS)
      • Story Block (iOS)
      • Customization (iOS)
        • Video feed configurations (iOS)
        • Player configurations (iOS)
        • Shopping configurations (iOS)
          • Customize product card on videos using the custom view (iOS)
        • Customize click behaviors (iOS)
      • Shopping (iOS)
      • Live Stream Support (iOS)
      • Analytics (iOS)
      • Share & Deeplinking(iOS)
      • Ad Support (iOS)
    • Sample App (iOS)
    • FAQ & Troubleshooting (iOS)
    • Changelog (iOS)
  • React Native SDK
    • Integration Guide for React Native SDK V2
      • Getting Started (React Native)
      • ATT compliance React Native (iOS)
      • Video Feed (React Native)
      • Story Block (React Native)
      • Customization (React Native)
        • Video feed configurations (React Native)
        • Player configurations (React Native)
        • Shopping configurations (React Native)
          • Customize product card on videos using the custom view (React Native)
        • Customize click behaviors (React Native)
      • Shopping (React Native)
      • Live Stream Support (React Native)
      • Ad Support (React Native)
      • Analytics (React Native)
      • App-level Language Setting (React Native)
      • Share & Video Deeplinking (React Native)
      • Android Style (React Native)
      • Inject Android Image Loader (React Native)
      • Integrate SDKs in Hybrid React Native and native Apps
      • Reference (React Native)
      • Sample App (React Native)
      • FAQ & Troubleshooting (React Native)
      • Changelog (React Native)
  • Flutter SDK
    • Integration Guide for Flutter SDK V2
      • Getting Started (Flutter)
      • ATT compliance Flutter (iOS)
      • Video Feed (Flutter)
      • Story Block (Flutter)
      • Customization (Flutter)
        • Video feed configurations (Flutter)
        • Player configurations (Flutter)
        • Shopping configurations (Flutter)
          • Customize product card on videos using the custom view (Flutter)
        • Customize click behaviors (Flutter)
      • Live Stream Support (Flutter)
      • Shopping (Flutter)
      • Ad Support (Flutter)
      • Analytics (Flutter)
      • App-level Language Setting (Flutter)
      • Share & Video Deeplinking (Flutter)
      • Inject Android Image Loader (Flutter)
      • Android Style (Flutter)
      • Integrate SDKs in Hybrid Flutter and native Apps
      • Reference (Flutter)
      • Sample App (Flutter)
      • FAQ & Troubleshooting (Flutter)
      • Changelog (Flutter)
  • Help Articles
    • Importing Products to Firework
    • Adding products to a video
    • Displaying product videos on product pages using hashtag filtering(Web)
    • Syncing Carts
    • Encoded IDs
Powered by GitBook
On this page
  • Event callbacks
  • Video playback event callbacks
  • Feed event callbacks
  • Live stream event callbacks
  • Data Tracking Level
  • External ad tracking configuration

Was this helpful?

  1. iOS SDK
  2. Integration Guide for iOS SDK

Analytics (iOS)

Event callbacks

Video playback event callbacks

To receive video playback events, conform to the FireworkVideoPlaybackDelegate protocol, see file FireworkVideoPlaybackDelegate.swift. You could assign FireworkVideoPlaybackDelegate delegate as follows:

FireworkVideoSDK.eventTracking.videoPlaybackDelegate = // Object to receive video playback events

List of video playback events:

    /// Called when a video appears on the screen but the video playback has not started
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidRecordImpression(_ videoPlayback: VideoPlaybackDetails)

    /// Called when a video has paused playback
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidPause(_ videoPlayback: VideoPlaybackDetails)

    /// Called when a video has resumed playback
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidResume(_ videoPlayback: VideoPlaybackDetails)

    /// Called when a video has started playing
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidStartPlaying(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the first quarter of the video has been played
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoReachedFirstQuartile(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the first half of the video has been played
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoReachedMidPoint(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the third quarter of the video has been played
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoReachedThirdQuartile(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the video reaches end of playback.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidFinishPlaying(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the user has tapped on the CTA button that appeared during the video playback
    func fireworkVideoDidTapCTAButton(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the user has tapped on the share button that appeared during the video playback
    func fireworkVideoDidTapShareButton(_ videoPlayback: VideoPlaybackDetails)

    /// Called when an ad video has started playing
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidStartPlayingAd(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the ad video reaches end of playback.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidFinishPlayingAd(_ videoPlayback: VideoPlaybackDetails)
    
    /// Called when the video is muted.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidMute(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the video is unmuted.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidUnmute(_ videoPlayback: VideoPlaybackDetails)

    /// Called when the user closes or skips to the other video manually.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidClose(_ videoPlayback: VideoPlaybackDetails)
    
    /// Called when the video is automatically paused.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidAutomaticallyPause(_ videoPlayback: VideoPlaybackDetails)
    
    /// Called when the video is automatically resumed.
    /// - Parameter videoPlayback: The details of the video playback
    func fireworkVideoDidAutomaticallyResume(_ videoPlayback: VideoPlaybackDetails)

Feed event callbacks

To receive feed related events, conform to the FireworkVideoFeedDelegate protocol, see file FireworkVideoFeedDelegate.swift. You could assign FireworkVideoFeedDelegate delegate as follows:

FireworkVideoSDK.eventTracking.feedDelegate = // Object to receive feed events

List of feed events:

    /// Called when the a video thumbnail is tapped by the user
    /// - Parameter eventDetails: The details of the feed event
    func fireworkVideoDidTapThumbnail(_ eventDetails: FeedEventDetails)

Live stream event callbacks

Live stream events can be observed by assigning a receiver as the FireworkLiveStreamEventDelegate. This will provide different methods that will be invoked at the time of each event. You could assign FireworkLiveStreamEventDelegate as follows:

// Assign a delegate
FireworkVideoSDK.eventTracking.liveStreamEventDelegate = // Object to receive live stream events

List of live stream events:

/// Delegate that handles live stream events
public protocol FireworkLiveStreamEventDelegate: AnyObject {
    /**
     Called when a user joins an active live stream.
     - Parameter liveStream: Details about the live stream event are included.
     */
    func fireworkLiveStreamUserDidJoin(_ liveStream: LiveStreamEventDetails)
    /**
     Called when the user leaves an active live stream.
     - Parameter liveStream: Details about the live stream event are included.
     */
    func fireworkLiveStreamUserDidLeave(_ liveStream: LiveStreamEventDetails)
    /**
     Called when a user sends a message to an active live stream.
     - Parameters:
       - message: Details of the chat message sent
       - liveStream: Details about the live stream event are included.
     */
    func fireworkLiveStreamUserDidSendChat(_ message: LiveStreamMessageDetails, to liveStream: LiveStreamEventDetails)
    /**
     Called when a user sends a like to an active live stream.
     - Parameter liveStream: Details about the live stream event are included.
     */
    func fireworkLiveStreamUserDidSendLike(_ liveStream: LiveStreamEventDetails)
}

Data Tracking Level

The SDK provides a way to specify the level of data tracking that should be performed. The default value is .all. To change the data tracking level, use the following API:

FireworkVideoSDK.analytics.dataTrackingLevel = .essentialOnly // Only essential data will be tracked
// OR
FireworkVideoSDK.analytics.dataTrackingLevel = .all // All data will be tracked
// OR
FireworkVideoSDK.analytics.dataTrackingLevel = .none // No data will be tracked

External ad tracking configuration

We always report external ad tracking by default. You can disable it by the following codes:

FireworkVideoSDK.externalAdTrackingEnabled = false
PreviousLive Stream Support (iOS)NextShare & Deeplinking(iOS)

Last updated 2 months ago

Was this helpful?