Skip to main content

Installation and Integration with Maestro tvOS SDK

This section will walk you through the process of installing and integrating the Maestro tvOS SDK into your tvOS application.

Prerequisites

Before you begin, ensure you have:

  • Your Maestro siteID
  • A tvOS application where you want to integrate the SDK
  • Xcode installed on your development machine

Installation

To add MaestroKit to your tvOS project, choose one of the following methods, based on your preferred dependency management approach.

Swift Package Manager

To add MaestroKit using Swift Package Manager:

  1. Open your Xcode project.
  2. Go to File > Swift Packages > Add Package Dependency.
  3. When prompted with Choose Package Repository Enter the URL for the MaestroKit SDK package: https://github.com/lessthan3/MaestroKit.swift and Click Next.
  4. Choose the desired version rule, or select a specific branch, tag, or commit. Then Click Next
  5. Xcode will resolve the package and present you with options to add the package to your targets.
  6. Make sure your main target is selected and click Finish.
  7. The MaestroKit SDK package will be added to your project.

Updating the Package

If you already have MaestroKit installed in your project and want to update to the latest version:

  1. Go to File -> Packages -> Update to Latest Package Versions

Manual Adding the Framework

To add the MaestroKit framework into your project:

  1. Open your Xcode project.
  2. Select your project's name in the Project Navigator panel.
  3. Choose your project's target in the Project panel that appears.
  4. Choose the General tab.
  5. Scroll down to the Frameworks, Libraries, and Embedded Content section of the General tab.
  6. Click the plus button to add the framework.
  7. In the dialog that appears, click the Add Other... dropdown menu and select Add Files...
  8. Locate the MaestroKit.xcframework file.

Basic Integration Steps

1. Import the SDK

Import MaestroKit in your Swift files:

import MaestroKit

2. Configure the SDK

MaestroManager.configure(
siteID: "your-site-id",
jwt: "your-jwt",
maestroManagerDelegate: MaestroEventDelegate(), // Your implementation of MaestroEventDelegate
maestroWorkingEnviroment: .prod,
defaultPanel: .stats
)

3. Initialize Event

let eventID = "your-event-id"
let delegate = MaestroEventDelegate() // Your implementation of MaestroEventDelegate

await MaestroManager.shared.userDidStartWatchingEvent(
eventID: eventID,
delegate: delegate,
hideBetsPanel: false,
hideBetsWagers: false,
disableBetsOverlays: false,
disableFantasyOverlays: false
)

For a complete example of integration, refer to our Example Repo for the Maestro tvOS SDK.