GADInterstitial

@interface GADInterstitial : NSObject

An interstitial ad. This is a full-screen advertisement shown at natural transition points in your application such as between game levels or news stories.

  • Initializes an interstitial with an ad unit created on the AdMob website. Create a new ad unit for every unique placement of an ad in your application. Set this to the ID assigned for this placement. Ad units are important for targeting and statistics.

    Example AdMob ad unit ID: @ca-app-pub-0123456789012345/0123456789

    Declaration

    Swift

    init(adUnitID: String)

    Objective-C

    - (nonnull instancetype)initWithAdUnitID:(nonnull NSString *)adUnitID;
  • The interstitial’s ad unit ID.

    Declaration

    Swift

    var adUnitID: String? { get }

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *adUnitID;
  • Optional delegate object that receives state change notifications from this GADInterstitalAd.

    Declaration

    Swift

    weak var delegate: GADInterstitialDelegate? { get set }

    Objective-C

    @property (readwrite, nonatomic, nullable) id<GADInterstitialDelegate> delegate;
  • Makes an interstitial ad request. Additional targeting options can be supplied with a request object. Only one interstitial request is allowed at a time.

    This is best to do several seconds before the interstitial is needed to preload its content. Then when transitioning between view controllers show the interstital with presentFromViewController.

    Declaration

    Swift

    func load(_ request: GADRequest?)

    Objective-C

    - (void)loadRequest:(nullable GADRequest *)request;
  • Returns YES if the interstitial is ready to be displayed. The delegate’s interstitialAdDidReceiveAd: will be called after this property switches from NO to YES.

    Declaration

    Swift

    var isReady: Bool { get }

    Objective-C

    @property (readonly, nonatomic) BOOL isReady;
  • Returns YES if this object has already been presented. Interstitial objects can only be used once even with different requests.

    Declaration

    Swift

    var hasBeenUsed: Bool { get }

    Objective-C

    @property (readonly, nonatomic) BOOL hasBeenUsed;
  • Information about the ad response that returned the current ad. Nil while an ad request is in progress or if the latest ad request failed.

    Declaration

    Swift

    var responseInfo: GADResponseInfo? { get }

    Objective-C

    @property (readonly, nonatomic, nullable) GADResponseInfo *responseInfo;
  • Presents the interstitial ad which takes over the entire screen until the user dismisses it. This has no effect unless isReady returns YES and/or the delegate’s interstitialDidReceiveAd: has been received.

    Set rootViewController to the current view controller at the time this method is called. If your application does not use view controllers pass in nil and your views will be removed from the window to show the interstitial and restored when done. After the interstitial has been removed, the delegate’s interstitialDidDismissScreen: will be called.

    Declaration

    Swift

    func present(fromRootViewController rootViewController: UIViewController)

    Objective-C

    - (void)presentFromRootViewController:
        (nonnull UIViewController *)rootViewController;
  • Deprecated delegate. GADInAppPurchase is deprecated.

    Declaration

    Swift

    weak var inAppPurchaseDelegate: GADInAppPurchaseDelegate? { get set }

    Objective-C

    @property (readwrite, nonatomic, nullable) id<GADInAppPurchaseDelegate>
        inAppPurchaseDelegate;
  • Deprecated intializer. Use initWithAdUnitID: instead.

    Declaration

    Swift

    convenience init()

    Objective-C

    - (nonnull instancetype)init;
  • Deprecated. Use responseInfo.adNetworkClassName instead.

    Declaration

    Swift

    var adNetworkClassName: String? { get }

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *adNetworkClassName;