setDataToPanel
Set custom data to a panel - mostly for debugging/testing purposes.
Overview
Call this method to set custom data overrides to a panel. This is primarily intended for debugging and testing purposes.
Method Signature
fun setDataToPanel(data: CustomPanelData)
Parameters
| Parameter | Type | Description |
|---|---|---|
data | CustomPanelData | Custom data to set on the panel |
CustomPanelData
CustomPanelData is a data class used to supply custom overrides to panel content.
data class CustomPanelData(
val stats: Stats? = null,
) {
data class Stats(
val overrideUrl: String,
)
}
| Property | Type | Default | Description |
|---|---|---|---|
stats | Stats? | null | Stats-specific overrides. When provided, the SDK fetches stats data from the supplied URL instead of the default endpoint. |
stats.overrideUrl | String | Required | The URL from which stats data will be fetched. |
Return Value
This method does not return a value.
Example
// Override the stats data URL for testing
sdk.setDataToPanel(
CustomPanelData(
stats = CustomPanelData.Stats(
overrideUrl = "https://your-server.example.com/stats/test-event.json"
)
)
)
// Clear overrides by passing null for each field
sdk.setDataToPanel(CustomPanelData())
Notes
- This method is primarily for debugging and testing purposes
- Use this to override panel data during development
- When
stats.overrideUrlis set, the SDK bypasses its default stats endpoint for the duration of the session
Related Methods
- configure() - Initial SDK configuration
- onEventDataUpdated() - Update event data