Advertisement

interface Advertisement

A key object interface describing the advertisement.

An instance of this interface can be created using AdService.makeAdvertisement method. Responsible for loading and reloading ad, creating, storing and updating the AdRenderer.

Note: Since Advertisement is not a lifecycle-aware component, the application developer should control the lifecycle from within the application in order to avoid leaks. To clean up and cancel all internal tasks, dispose method should be called when the ad is no longer needed.

Properties

Link copied to clipboard
abstract val adRenderer: AdRenderer?

The AdRenderer which is used to render the advertisement.

Link copied to clipboard
abstract val loadingState: StateFlow<AdvertisementLoadingState>

State flow for the presentation control.

Link copied to clipboard

The type of placement is specified when creating the ad.

Link copied to clipboard
abstract val request: AdRequest

The AdRequest which was used to load this ad and is used to manage it.

Functions

Link copied to clipboard
abstract fun dispose()

Cleans up resources when the ad is no longer needed.

Link copied to clipboard
abstract suspend fun getMetadata(): AdMetadata?

Method for getting the AdMetadata, which contains the basic data about the ad and current renderer.

Link copied to clipboard
abstract suspend fun performDSATap()

A method for processing tap on DSA button.

Link copied to clipboard
abstract suspend fun performTapEvent(event: AdTapEvent)

This method is responsible for firing the tap event manually.

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

Reloads advertisement.

Link copied to clipboard
abstract fun visibilityChanged(visibility: AdVisibilityPercentage)

A method for performing tracking events related to visibility.