Interstitial Ad Handler
An InterstitialAdHandler is a full-screen ad that cover the interface of the host app. They're typically displayed at natural transition points in the flow of an app, such as between activities or during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app.
Parameters
activity
Android required Activity
// Instantiate
val ad = InterstitialAd(activity)
// Load the Ad
ad.load(
adUnitId = "AD_UNIT_ID_GOES_HERE", // Interstitial 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
Link copied to clipboard
Determines the AdState of the InterstitialAdHandler
Determines the AdState of the InterstitialAdHandler
Determines the AdState of the InterstitialAdHandler
Functions
Link copied to clipboard