BannerAdCompose

fun BannerAdCompose(adUnitId: String, modifier: Modifier = Modifier, onAdLoaded: () -> Unit? = null, onAdFailedToLoad: (AdError?) -> Unit? = null, onAdClicked: () -> Unit? = null, onAdImpression: () -> Unit? = null, onAdOpened: () -> Unit? = null, onAdClosed: () -> Unit? = null, onPaidEvent: (AdValue) -> Unit? = null)

A Jetpack Compose wrapper for BannerAdView from AdManageKit.

This composable provides an easy way to display banner ads in Compose UIs while maintaining all the functionality of the original BannerAdView.

Since

2.1.0

Parameters

adUnitId

The AdMob ad unit ID

modifier

Modifier for styling the ad container

onAdLoaded

Callback when the ad loads successfully

onAdFailedToLoad

Callback when the ad fails to load

onAdClicked

Callback when the ad is clicked

onAdImpression

Callback when the ad impression is recorded

onAdOpened

Callback when the ad opens an overlay

onAdClosed

Callback when the ad overlay is closed

onPaidEvent

Callback when a paid event occurs (for revenue tracking)


fun BannerAdCompose(adUnitId: String, width: Dp, height: Dp, modifier: Modifier = Modifier, onAdLoaded: () -> Unit? = null, onAdFailedToLoad: (AdError?) -> Unit? = null, onAdClicked: () -> Unit? = null, onAdImpression: () -> Unit? = null, onAdOpened: () -> Unit? = null, onAdClosed: () -> Unit? = null, onPaidEvent: (AdValue) -> Unit? = null)

A Jetpack Compose wrapper for BannerAdView with custom dimensions.

Parameters

adUnitId

The AdMob ad unit ID

width

Width in dp for the banner ad

height

Height in dp for the banner ad

modifier

Modifier for styling the ad container

onAdLoaded

Callback when the ad loads successfully

onAdFailedToLoad

Callback when the ad fails to load

onAdClicked

Callback when the ad is clicked

onAdImpression

Callback when the ad impression is recorded

onAdOpened

Callback when the ad opens an overlay

onAdClosed

Callback when the ad overlay is closed

onPaidEvent

Callback when a paid event occurs (for revenue tracking)