The Virtual Stadium Data SDK provides a set of services and providers that allow you to interact with the Virtual Stadium platform. These services are designed to handle various aspects of the user experience, from authentication to chat management.
Services related to chat functionality available in the project are:
LoginManager is used to handle login to the SDK with JWT. Without it usage of SDK is basically impossible. (check Login Manager section)UserProvider provides current state of the user (check User Status section)SettingsProvider provides settings for the channel e.g. message limitation, list of available reactions (check Settings section)OddsFormatProvider offers the possibility to get UK formats for the odds in the betslips (check Odds provider section)ChatManager serves as a central management point for chat channels within the Virtual Stadium Data SDK. It is designed to handle the lifecycle and organization of chat channels (check Chat Manager section)The SDK uses Koin for dependency handling internally. To use all mentioned providers in Android, you can inject them via Koin in your ViewModel or any other class where you need them. If you don't want to rely on Koin you can also use a KoinHelper which is available as the part of SDK and provides getters for all mentioned providers.
import ag.sportradar.virtualstadium.datasdk.services.ChatManager
import ag.sportradar.virtualstadium.datasdk.services.LoginManager
import ag.sportradar.virtualstadium.datasdk.services.OddsFormatProvider
import ag.sportradar.virtualstadium.datasdk.services.SettingsProvider
import ag.sportradar.virtualstadium.datasdk.services.UserProvider
import androidx.lifecycle.ViewModel
import org.koin.core.component.KoinComponent
import org.koin.core.component.get
class ExampleViewModel :
ViewModel(),
KoinComponent {
private val loginManager: LoginManager by inject()
private val userProvider: UserProvider by inject()
private val settingsProvider: SettingsProvider by inject()
private val oddsFormatProvider: OddsFormatProvider by inject()
private val chatManager: ChatManager by inject()
...
}
To use all mentioned providers in iOS, you must get them via KoinHelper getters.
import VirtualStadiumDataSDK
class ExampleViewModel {
private let loginManager = KoinHelper().getLoginManager()
private let userProvider = KoinHelper().getUserProvider()
private let settingsProvider = KoinHelper().getSettingsProvider()
private let oddsFormatProvider = KoinHelper().getOddsFormatProvider()
private let chatManager = KoinHelper().getChatManager()
...
}