Interstitial Ad
app_show_type: 50000
Interstitial ads are full-screen ads that cover the interface of an app until closed by the user. 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.
This guide shows you how to integrate interstitial ads into an iOS app.
Import Header Files.
Create an interstitial ad object.
Interstitial ads are requested and shown by CMAInterstitial
objects. The first step in using one is to instantiate it and set its ad posid. For example, here's how to create a CMAInterstitial
in the viewDidLoad method of a UIViewController:
CMAInterstitial
is a single-use object that will load and display one interstitial ad. To display multiple interstitial ads, an app needs to create a CMAInterstitial
for each one.
Set up event notifications
To set up event notifications, insert the line before your load request call.
The following sample illustrates how to log each of the events available in CMAInterstitialDelegate:
Load Ads
To load an interstitial ad, call loadAd: on a CMAInterstitial object:
Show Ads
If the ad is loaded successfully, following function will be called!
Last updated