Getting Started (iOS)

Introduction

FireworkVideo is a library to integrate video feeds from Firework - a short form video platform - into your iOS app.

To integrate FireworkVideo into your application, you have to register your application with Firework platform and get unique FireworkVideo app ID. To get the app ID:

  • Provide your application's bundle identifier or package name to the business team / engineering team you are co-ordinating with.

  • You will receive via email the app ID and then follow the setup steps below under Firework IDs to include both in your app.

The app ID is used to authenticate your application with the server. Authentication will fail if you use wrong app ID.

Requirements

FireworkVideo is compatible with:

  • iOS 13+

  • Xcode 14+

  • Swift 5.5+

How to add FireworkVideo to your Xcode project?

FireworkVideo can be added as a Swift binary package using Swift Package Manager or it can be imported manually as framework. Instructions for both installation methods are below.

Importing Using Swift Package Manager

In your Xcode project, select File > Swift Packages > Add Package Dependency and enter the following URL: https://github.com/loopsocial/firework_ios_sdk.git

If you are new to Xcode's Swift Pacakage Manager integration, please refer to Apple's documentation on Adding a Package Dependency to Your App

Select Version > Up to Next Major > {Latest Version from CHANGELOG.md}

Latest version release notes can be found here

Importing Using Cocoapods

In your Podfile add FireworkVideo: pod FireworkVideo and then run pod install.

Supporting Libraries

The SDK has many supporting libraries that can be easily added to your project.

  • Multihost Streaming - Add pod 'FireworkVideo/FireworkMultiHostStreaming

  • Low Latency Streaming - Add pod 'FireworkVideo/FireworkLowLatencyStreaming

  • Interactive Media Ads - Add pod 'FireworkVideo/FireworkInteractiveMediaAds

  • Google Ad Manager - Add pod 'FireworkVideo/FireworkGoogleAdManager

Importing FireworkVideo Framework Manually

  • Clone the SDK repo located at https://www.github.com/loopsocial/firework_ios_sdk/

  • Download the SDK binary and unzip if needed.

  • Drag the unzipped FireworkVideo.xcframework into the Xcode project navigator and drop it at root of your project. Make sure Copy items if needed checkbox is selected in the confirmation dialog. Check to make sure your project directory now has FireworkVideo.xcframework in it and it is visible and linked in your Xcode project navigator.

  • In your apps Project pane select your app Target > Build Phases, click the + button, and add a Copy Files step. Select Frameworks as the destination and click the + within the Copy Files step and select FireworkVideo.xcframework. Your Copy Files step should look like below.

Firework IDs

Include the app ID in your app Info.plist file using the key FireworkVideoAppID see image below. If the app ID is not included or is included under a differently spelled key, the SDK will return an error. See Troubleshooting for more details.

Using FireworkVideo

Sample Code

There is a sample project available under FireworkVideoSample that sets up the FireworkVideo framework using Swift Package Manager (SPM). Please read-over the sample code documentation located in FireworkVideoSample/README.md for setup tips.

Shopping Sample Code

Within the sample app project there is a second app FireworkVideoShoppingSample that contains samples for integrating with FireworkVideoShopping. Please read-over the shopping sample code documentation located in the FireworkVideoSample/FireworkVideoShoppingSample/README.md for setup tips.

Privacy manifest guideline SDK has privacy manifest configuration to ensure compliance with privacy guidelines and regulations. Please use the AppTrackingTransparency framework to present an app-tracking authorization request to the user and provide the tracking authorization status.

Initialization

Before using any components video components are used you must initialize FireworkVideo.

Start by importing the SDK into your App Delegate. Then initialize the Firework Video SDK in the App Delegate method application(:, didFinishLaunchingWithOptions:) -> Bool.

import UIKit

// Add the dependency SDK
import FireworkVideo

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        // Initialize the SDK to start using
        FireworkVideoSDK.initializeSDK()

        // SDK has privacy manifest configuration to ensure compliance with privacy guidelines and regulations. Please use the `AppTrackingTransparency` framework to present an app-tracking authorization request to the user and provide the tracking authorization status.

        return true
    }

    // ... //
}

Last updated