iOS SDK Documentation

iOS - Getting Started

The SDK is available for iOS (version 12 or newer) as a Swift Package or a CocoaPod library.


iOS - SDK Integration


iOS - Using the SDK

  1. Import the SportBuff framework in your Swift file:

    import SportBuff
    
  2. Initialize the SDK with your client name:

    SportBuff.initialize(clientAccount: <CLIENT_NAME>, anonymousLogin: <BOOL>)
    
  3. Optional: Login a user manually:

    SportBuff.signInUser(token: <TOKEN>) { result in }
    
    SportBuff.signInUserAnonymously { result in }
    
    SportBuff.onSignUp = { }
    

    Assigning a closure to onSignUp executes the provided code when the signup button is clicked, enabling custom signup implementation.

CLIENT_NAME is unique per client and provided during onboarding.

anonymousLogin should only be enabled if explicitly set for your account. Set to FALSE unless instructed otherwise.

For backend authentication, see the Backend Authentication Documentation.


iOS - Configuring the SDK

The SDK provides a custom BuffView for displaying UI elements over your video view. Add BuffView as shown below:

private let buffView = BuffView()

private func setupUI() {
    buffView.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(buffView)

    NSLayoutConstraint.activate([
        buffView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
        buffView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
        buffView.topAnchor.constraint(equalTo: view.topAnchor),
        buffView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
    ])
}