getDefaultPanel
Initialization: Specifying the Default Panel
When you call configure(...), you now pass a defaultPanel value to determine which panel the SDK should show immediately after initialization:
public nonisolated func configure(
siteID: String,
jwt: String,
maestroManagerDelegate: MaestroManagerDelegate,
maestroWorkingEnvironment: MaestroWorkingEnvironment,
defaultPanel: MaestroPanelType
) {
ConfigManager.shared.environment = maestroWorkingEnvironment
Task {
await self.setMaestroManagerDelegate(maestroManagerDelegate)
await self.setSiteID(siteID)
await self.setDefaultPanel(defaultPanel)
// ... authorization and analytics setup ...
}
}
Why? Providing
defaultPanelat startup ensures that your host app controls which tab (e.g.,.stats,.bets,.overview) appears first—without any additional API calls.
Example:
actor TestAppInteractor {
nonisolated func initializeSDK(maestroManagerDelegate: MaestroManagerDelegate) {
MaestroManager.shared.configure(
siteID: SampleAppUIConstants.testSiteID,
jwt: SampleAppUIConstants.testMaestroJwtToken,
maestroManagerDelegate: maestroManagerDelegate,
maestroWorkingEnvironment: .qa,
defaultPanel: .stats // Show Stats panel on launch
)
}
}
Retrieving the Default Panel
To query which panel was set during initialization, use:
public func getDefaultPanel() -> MaestroPanelType {
return defaultPanel
}
This allows your host app to inspect or reapply the startup panel choice as needed.
Note: Ensure your UI observes
MaestroEventViewModel.currentPanelso that panel changes take effect immediately.