Advertisement

Main Advertisement object. Can be created independently of presentation, then passed to rememberAdState in Compose. In order to fetch the Ad, loadAdvertisement method should be called.

Constructors

Link copied to clipboard
constructor(contentId: String, adTypes: List<String>, wi: UInt? = null, timeoutAfterSeconds: UInt? = null, profiles: HashMap<String, String> = hashMapOf(), keywords: List<String> = listOf(), gdprPd: Boolean? = null, serverSideHeaderBidding: Boolean? = null, campaignId: String? = null, bannerId: String? = null, dsa: DSA? = null, placementType: PlacementType = PlacementType.INLINE, targetURLHandler: TargetURLHandlerInterface? = null)

Advertisement constructor

constructor(learningTag: Map<String, String>, adTypes: List<String>, wi: UInt? = null, timeoutAfterSeconds: UInt? = null, profiles: HashMap<String, String> = hashMapOf(), keywords: List<String> = listOf(), gdprPd: Boolean? = null, serverSideHeaderBidding: Boolean? = null, campaignId: String? = null, bannerId: String? = null, dsa: DSA? = null, placementType: PlacementType = PlacementType.INLINE, targetURLHandler: TargetURLHandlerInterface? = null)

Advertisement constructor

constructor(bundle: Bundle)

Bundle constructor

constructor(adParameters: AdvertisementParameters)

Types

Link copied to clipboard
interface State : Parcelable

Properties

Link copied to clipboard
open override var adMetaData: AdMetaData?
Link copied to clipboard
Link copied to clipboard
open override var adResponse: AdResponse?
Link copied to clipboard
Link copied to clipboard
open override var fullResultData: FullResultData?
Link copied to clipboard
open override val state: StateFlow<Advertisement.State>

Functions

Link copied to clipboard
open override fun checkAndNotifyEvents(eventType: TrackingEventType)
Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
suspend fun downloadImage(url: String): Result<Bitmap>

Downloads an ad image

Link copied to clipboard
open suspend override fun loadAdvertisement(): Advertisement.State

Loads an advertisement from the server and manages the state depending on the result. Notifies an IMPRESSION event if the AdResponse contains a trigger for it.

Link copied to clipboard

Save Advertisement to bundle so it wouldn't be re-fetched when destroyed when scrolling the list for example

Link copied to clipboard
open override fun setState(state: Advertisement.State)

Set state of the ad

Link copied to clipboard
open override fun triggerAdClick(url: String?)

Triggers the ad click.

Link copied to clipboard
open override fun triggerCustomEvent(name: String, info: String)
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)