BannerAdController

Controls a single banner ad placement. Handles loading, refresh, and lifecycle. For Compose UI, prefer BannerAdView which manages the controller automatically.

Properties

Link copied to clipboard
abstract val events: SharedFlow<AdEvent>

Shared flow of banner lifecycle events.

Link copied to clipboard
abstract val loadState: StateFlow<AdLoadState>

Current load state of the banner ad.

Link copied to clipboard
abstract val placement: AdPlacement

The placement this controller is bound to.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun clear()

Clears the loaded ad and releases resources.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract suspend fun load(geometry: BannerGeometry? = null, sizePolicy: AdSizePolicy = placement.bannerSizePolicy, requestOptions: AdRequestOptions = placement.requestOptions): AdLoadState

Loads a banner sized for geometry using sizePolicy and requestOptions.

Link copied to clipboard
abstract suspend fun refresh(): AdLoadState

Reloads the banner, replaying the geometry, size policy AND request options resolved by the most recent load. Fails if nothing has been loaded yet.

Link copied to clipboard
Link copied to clipboard