AdService

object AdService

A key object for configuring your advertisements.

It is responsible for initial configuration, creating Advertisement objects, managing caching, and performing tag and tracking requests.

Properties

Link copied to clipboard

Global information about an application environment.

Link copied to clipboard
lateinit var networkId: String

The unique identifier of the ad network.

Functions

Link copied to clipboard
suspend fun flushCache(): AdResult<Unit>

Removes all objects from the cache.

Link copied to clipboard

A method to get the built-in cache.

Link copied to clipboard

Getter method for the AdService object.

Link copied to clipboard

The current version of the sdk.

Link copied to clipboard
suspend fun init(networkId: String, context: Context, timeout: UInt?, cacheSize: UShort?, cachePath: String?): AdResult<Unit>

Internal method for configuring AdService.

Link copied to clipboard
suspend fun makeAdvertisement(adRequest: AdRequest, placementType: AdPlacementType = AdPlacementType.INLINE, adEventListener: AdEventListener? = null, targetURLHandler: TargetURLHandler? = null): AdResult<Advertisement>

Creating an Advertisement object and performing ad request.

Link copied to clipboard
suspend fun registerRenderer(name: String, factory: () -> AdRenderer)

Registers a custom ad renderer.

Link copied to clipboard

A method for removing global parameters from AdRequest.

Link copied to clipboard

A method for removing global parameters from TagRequest and TrackingRequest.

Link copied to clipboard

A method for setting global parameters for AdRequest before calling the makeAdvertisement method.

Link copied to clipboard
suspend fun setCachePath(path: String): AdResult<Unit>

Method to set the path for the ad cache.

Link copied to clipboard
suspend fun setCacheSize(sizeInMb: UShort): AdResult<Unit>

Changes the maximum cache size on disk.

Link copied to clipboard

A method for setting global parameters for TagRequest and TrackingRequest before calling tagUser&trackingRequest methods.

Link copied to clipboard
suspend fun tagUser(tagRequest: TagRequest): AdResult<Unit>

Trigger a request to "tag" a user.

Link copied to clipboard
suspend fun trackingRequest(trackingRequest: TrackingRequest): AdResult<Unit>

Trigger a request for conversion tracking.

Link copied to clipboard
suspend fun unregisterRenderer(name: String): () -> AdRenderer?

Unregisters the custom ad renderer.