WebcomConfiguration

data class WebcomConfiguration @JvmOverloads constructor(identifier: String, platform: URL?, offlineCache: String?, startOnline: Boolean, websocketProtocol: WebcomConfiguration.WebsocketProtocol, pingDelayMs: Int?, pongDelayMs: Int?)

Represents the settings of a WebcomApplication instance.

WebcomConfiguration instances are generally built using the fromProperties and fromAsset methods.

Constructors

WebcomConfiguration
Link copied to clipboard
fun WebcomConfiguration(identifier: String, platform: URL? = null, offlineCache: String? = null, startOnline: Boolean = true, websocketProtocol: WebcomConfiguration.WebsocketProtocol = defaultWebsocketProtocol, pingDelayMs: Int? = null, pongDelayMs: Int? = null)

Builds a WebcomConfiguration instance with specific settings.

Types

Companion
Link copied to clipboard
object Companion

Provides with a set of methods to easily build WebcomConfiguration instances.

WebsocketProtocol
Link copied to clipboard

Available versions of the websocket protocol between the Webcom SDK client and the Webcom back end.

Functions

withOfflineCache
Link copied to clipboard
fun withOfflineCache(offlineCache: String): WebcomConfiguration

Creates a copy of this WebcomConfiguration with the WebcomConfiguration.offlineCache property set to offlineCache.

withStartOnline
Link copied to clipboard
fun withStartOnline(startOnline: Boolean): WebcomConfiguration

Creates a copy of this WebcomConfiguration with the WebcomConfiguration.startOnline property set to startOnline.

Properties

identifier
Link copied to clipboard
val identifier: String

The identifier of the Webcom application. Mandatory

offlineCache
Link copied to clipboard
val offlineCache: String? = null

The offline data to restore into the local cache when starting the Webcom application. The specified data must have been previously retrieved using DatasyncService.offlineCache.

pingDelayMs
Link copied to clipboard
val pingDelayMs: Int? = null

The delay (expressed in milliseconds) between ping requests when there is no activity on the websocket. If not set, a default value is used.

platform
Link copied to clipboard
val platform: URL? = null

The URL of the Webcom back end to use. Optional: if not set, the production back end is used by default.

pongDelayMs
Link copied to clipboard
val pongDelayMs: Int? = null

The maximum delay (expressed in milliseconds) for the back end to respond a ping request on the websocket. If not set, a default value is used.

startOnline
Link copied to clipboard
val startOnline: Boolean = true

Indicates whether the DatasyncService will open the websocket to the Webcom back end at start up.

websocketProtocol
Link copied to clipboard

The version of the websocket protocol to use to communicate with the Webcom back end. Advanced usage: prefer using the default value.