ADInterstitial class provides full-screen advertisements that your iPad application displays to the user.
- iOS 4.3–10.0Deprecated
- Mac Catalyst 13.0–13.0Deprecated
When the user taps a full-screen advertisement, the advertisement launches a full-screen ad with rich media and interactive capabilities. Your application is notified when the advertisement is launched, but does not otherwise interact with the ad. You receive revenue when users view the advertisements or interact with the advertisements displayed by your application.
To use a full-screen ad in your application, instantiate a new
ADInterstitial object and set its delegate; your delegate is called when the ad finishes loading its content from the iAd network. Each full-screen ad only loads a single advertisement during its lifetime; each time your application wants to display a new advertisement, it must create a new
After your ad object loads its content, your application can display the ad in one of two ways. To display the content modally, your application presents by calling the ad object’s
present method, passing in a view controller to display the content. A modal advertisement interrupts the flow of control, requiring the user to either interact with the ad or explicitly close it before the application completes the user’s current task. Alternatively, your application can create a full-screen view and call the ad object’s
present(in:) method to host the advertisement in that view. A view-based advertisement is almost always added as a subview to a
UIScroll object; this allows the advertisement to be scrolled on and off the screen alongside other pages of content provided by your application.
Regardless of how your application displays the full-screen advertisement, users interact with the advertisement by tapping on it. When a user taps the advertisement, your delegate’s
interstitial is called to pause your application’s actives, after which the ad downloads the rich media experience from the iAd network and displays it to the user. After the user finishes interacting with the ad, the delegate’s
interstitial method is called to complete the action.
After an advertisement expires, it is automatically removed from the screen. The ad object calls the delegate’s
interstitial method to notify your application that the advertisement is no longer being displayed. At a minimum, your application should release the ad object, but your application may want to perform additional cleanup tasks. For example, if your application created a view to display the advertisement, it may want to remove that view from the view hierarchy or provide new content to be displayed in that view.
ADInterstitial class may not be subclassed.