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:
- Open your Xcode project.
- Go to
File > Swift Packages > Add Package Dependency. - When prompted with Choose Package Repository Enter the URL for the MaestroKit SDK package: https://github.com/lessthan3/MaestroKit.swift and Click Next.
- Choose the desired version rule, or select a specific branch, tag, or commit. Then Click Next
- Xcode will resolve the package and present you with options to add the package to your targets.
- Make sure your main target is selected and click Finish.
- 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:
- Go to
File -> Packages -> Update to Latest Package Versions
Manual Adding the Framework
To add the MaestroKit framework into your project:
- Open your Xcode project.
- Select your project's name in the Project Navigator panel.
- Choose your project's target in the Project panel that appears.
- Choose the General tab.
- Scroll down to the Frameworks, Libraries, and Embedded Content section of the General tab.
- Click the plus button to add the framework.
- In the dialog that appears, click the Add Other... dropdown menu and select Add Files...
- 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.