AdService

object AdService

A key object for configuring your advertisements. It is responsible for initial configuration, managing the ad cache and creating tag requests.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Initialization method for the AdService.

Functions

Link copied to clipboard

Clears the cache

Link copied to clipboard

Get access to the cache.

Link copied to clipboard

Getter method for the AdService

Link copied to clipboard

Returns current version of the SDK

Link copied to clipboard
suspend fun init(networkId: String, context: Context, eventHandler: EventHandler?, timeoutAfterSeconds: UInt? = Constants.DEFAULT_AD_REQUEST_TIMEOUT.toUInt(), cacheSizeInMb: Long? = Constants.DEFAULT_CACHE_SIZE, cachePath: String? = context.cacheDir.path + Constants.DEFAULT_CACHE_PATH): Boolean

Initialization method for the AdService. This sets up the httpclient and loads the cookies. Sets the context for the URL handling and the cache path and size.

Link copied to clipboard

A method for removing global parameters for ad request. Removes global parameters from ad request that were added using the

Link copied to clipboard

A method for removing global parameters for tag and track request. Removes global parameters from tag and track request that were added using the

Link copied to clipboard
suspend fun sendEventRequest(url: String)

Will "ping" EventTracker url when certain event is registered

Link copied to clipboard

A method for setting global parameters for all ad requests.

Link copied to clipboard

Set the path for the ad cache. The ad cache stores files locally to improve the performance of ads.

Link copied to clipboard
fun setCacheSize(sizeInMb: Long)
fun setCacheSize(sizeInMb: UShort)

Set the max size of the cache. If the cache size is exceeded, cache content is evicted following a FIFO policy.

Link copied to clipboard
Link copied to clipboard

A method for setting global parameters for all tag and track requests.

Link copied to clipboard
fun tagUser(tagRequests: List<TagRequest>)

Executed a list of tag requests.

Link copied to clipboard
fun trackUser(trackRequest: TrackRequest)

Execute tracking with specific track data

Link copied to clipboard
fun triggerAdEvent(eventType: EventType, contentId: String = "", adData: MutableMap<String, String>? = null, adMetaData: AdMetaData? = null)

Can be used to manual trigger an event. All parameter besides eventType are optional. There optional parameters are used to observe the events later in the App. So if not set you can not check for specific for contentUnit or pass and get additional infos via adData and adMetaData.