NetworkConfiguration

Represents the network communication configuration allowing the tracker to be able to send events to the Snowplow collector.

Default values: method = HttpMethod.POST; protocol = Protocol.HTTPS; timeout = 5 seconds;

Constructors

Link copied to clipboard
fun NetworkConfiguration(endpoint: String, method: HttpMethod = HttpMethod.POST)
Link copied to clipboard
fun NetworkConfiguration(networkConnection: NetworkConnection)
Link copied to clipboard

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun copy(): Configuration
Link copied to clipboard

A custom path which will be added to the endpoint URL to specify the complete URL of the collector when paired with the POST method.

Link copied to clipboard
fun okHttpClient(okHttpClient: OkHttpClient): NetworkConfiguration

An OkHttp client that will be used in the emitter, you can provide your own if you want to share your Singleton client's interceptors, connection pool etc.. Otherwise a new one is created.

Link copied to clipboard
fun okHttpCookieJar(okHttpCookieJar: CookieJar): NetworkConfiguration

An OkHttp cookie jar to override the default cookie jar that stores cookies in SharedPreferences. The cookie jar will be ignored in case custom okHttpClient is configured.

Link copied to clipboard

The timeout set for the requests to the collector. The maximum timeout for emitting events. If emit time exceeds this value TimeOutException will be thrown.

Properties

Link copied to clipboard
open override var customPostPath: String? = null
Link copied to clipboard
open override var endpoint: String? = null
Link copied to clipboard
open override var method: HttpMethod
Link copied to clipboard
open override var networkConnection: NetworkConnection? = null
Link copied to clipboard
open override var okHttpClient: OkHttpClient? = null
Link copied to clipboard
open override var okHttpCookieJar: CookieJar? = null
Link copied to clipboard
open override var protocol: Protocol?
Link copied to clipboard
open override var timeout: Int?