load

@RequiresPermission(value = "android.permission.INTERNET")
actual fun load(adUnitId: String, adSize: AdSize, onLoad: () -> Unit, onFailure: (Exception) -> Unit, onDismissed: () -> Unit, onShown: () -> Unit, onImpression: () -> Unit, onClick: () -> Unit)

Loads a banner ad.

Parameters

adUnitId

The ad unit ID.

adSize

The size of the ad.

onLoad

A callback invoked when the ad is loaded.

onFailure

A callback invoked when the ad fails to load.

onDismissed

A callback invoked when the ad is dismissed.

onShown

A callback invoked when the ad is shown.

onImpression

A callback invoked when an impression is recorded for the ad.

onClick

A callback invoked when the ad is clicked.

expect fun load(adUnitId: String = AdUnitId.BANNER_DEFAULT, adSize: AdSize = AdSize.FULL_BANNER, onLoad: () -> Unit = {}, onFailure: (Exception) -> Unit = {}, onDismissed: () -> Unit = {}, onShown: () -> Unit = {}, onImpression: () -> Unit = {}, onClick: () -> Unit = {})

Loads a banner ad. Note: Make all calls to the Mobile Ads SDK on the main thread.

To load a banner ad, call the load method and provide an ad unit ID and ad size.

Parameters

adUnitId

The ad unit ID for the banner ad.

adSize

The size of the banner ad.

onLoad

A callback invoked when the ad has finished loading.

onFailure

A callback invoked with an Exception when the ad fails to load or display.

onDismissed

A callback invoked when the ad is dismissed.

onShown

A callback invoked when the ad is shown on screen.

onImpression

A callback invoked when an ad impression has been recorded.

onClick

A callback invoked when the user clicks on the ad.

actual fun load(adUnitId: String, adSize: AdSize, onLoad: () -> Unit, onFailure: (Exception) -> Unit, onDismissed: () -> Unit, onShown: () -> Unit, onImpression: () -> Unit, onClick: () -> Unit)