Banner Ad Handler
A BannerAdHandler is a landscape ad that covers part of the host app screen.
Parameters
activity
Android required Activity
// Instantiate
val ad = BannerAd(activity, size)
// Load the Ad
ad.load(
adUnitId = "AD_UNIT_ID_GOES_HERE", // Banner Ad Unit ID from AdMob
onLoad = {
// ad.setListeners could go here instead
},
onFailure = { } // Callback when ad fails to load
)
// (optional) Observe what happens to the ad after it's shown
ad.setListeners(
onFailure = {}, // Callback when ad fails to display
onDismissed = {}, // Callback when ad is dismissed
onShown = {}, // Callback after ad is shown
onImpression = {}, // Callback after the ad makes an impression
onClick = {} // Callback on ad click
)
// Show the ad
ad.show()Content copied to clipboard
See also
Properties
banner View
Link copied to clipboard
Link copied to clipboard
Determines the AdState of the BannerAdHandler
Determines the AdState of the BannerAdHandler
Determines the AdState of the BannerAdHandler