AdRenderer

interface AdRenderer

Interface for the custom renderer.

You can create custom presentation to display advertisements. To do so, your presentation object must confirm to this interface. After, you can register your custom renderer type to display advertisements via AdService.registerRenderer.

Types

Link copied to clipboard
data class ServiceLocator(val appContext: Context, val eventHandler: AdRendererEventHandler, val assetRepository: AssetRepository, val assetRequestService: AssetRequestService, val assetCache: AssetCache)

A service locator that stores all possible services or information for creating a renderer.

Functions

Link copied to clipboard
abstract suspend fun configure(adResponse: String, adMetadata: AdMetadata): AdResult<Unit>

The method receives new data from the ad server to prepare and configure the AdRenderer.

Link copied to clipboard
open fun dispose()

Method for cleaning up resources when the renderer is no longer needed.

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

Method for cleaning the renderer data and states before reloading.

Link copied to clipboard
abstract fun RenderAd(modifier: Modifier)

Composite presentation of the renderer that should be displayed as part of the Ad.