dependencies {
implementation("ag.sportradar.virtualstadium.datasdk:shared-android:<data-sdk-version>")
...
}class VirtualStadiumApp : Application() {
override fun onCreate() {
super.onCreate()
VirtualStadiumSDK.init(<applicationContext>)
...
}
}Add the following package:
Select version and add the package. Import VirtualStudioDataSDK where needed.
Add the following to your Podfile:
source 'https://github.com/sportradar/VirtualStadium-SDK-Core-Pods.git'
target '<your target>' do
pod 'VirtualStadiumDataSDK', '0.1.361'
endRun pod install, then open the xcworkspace project file.
Import VirtualStadiumDataSDK in files where it's needed:
import VirtualStadiumDataSDKData SDK needs to be initialized before it can be used. To initialize the SDK, you need to pass two parameters to the doInit(_:) function:
context(Any): The UserDefaults class that provides a programmatic interface for interacting with the defaults system.Here’s an example of how to initialize the Data SDK:
class SDKManager {
// MARK: - Variables
let sdk: VirtualStadiumSDK = VirtualStadiumSDK()
init(jwtToken: String) {
sdk.doInit(context: UserDefaults())
}
}After a successful initialization, you can start using the SDK to fetch and send data.