Skip to main content

userDidStartWatchingEvent

MaestroKit provides the userDidStartWatchingEvent function to notify the SDK when a user opens an event in the app's player. This function requires two parameters: an event identifier and a delegate that conforms to MaestroEventDelegate. It returns an instance of MaestroEventInterface, which allows your app to interact with the currently loaded event.

ParameterTypeDescriptionExample
eventIDStringThe unique identifier for the event opened in the app's player."event123"
delegateMaestroEventDelegateAn instance of your implementation of the MaestroEventDelegate protocol, enabling communication between the SDK and your app.myEventDelegateInstance
hideBetsPanelBooleanA flag to determime whether to hide the bets panelfalse
hideBetsWagersBooleanA flag to determime whether to hide wagers on the bets panelfalse
disableBetsOverlaysBooleanA flag to determime whether to disable overlays for betsfalse
disableFantasyOverlaysBooleanA flag to determime whether to disable overlays for fantasyfalse

Code Example

Task {
let eventInterface = await MaestroManager.shared.userDidStartWatchingEvent(
eventID: "event123",
delegate: myEventDelegateInstance,
hideBetsPanel: false,
hideBetsWagers: false,
disableBetsOverlays: false,
disableFantasyOverlays: false

)
// eventInterface now conforms to MaestroEventInterface, allowing you to interact with the currently-loaded event.
}