GADInterstitialDelegate

@protocol GADInterstitialDelegate <GADAdDelegate>

Delegate for receiving state change messages from a GADInterstitial such as interstitial ad requests succeeding/failing.

  • Called when an interstitial ad request succeeded. Show it at the next transition point in your application such as when transitioning between view controllers.

    Declaration

    Swift

    optional func interstitialDidReceiveAd(_ ad: GADInterstitial!)

    Objective-C

    - (void)interstitialDidReceiveAd:(nonnull GADInterstitial *)ad;
  • Called when an interstitial ad request completed without an interstitial to show. This is common since interstitials are shown sparingly to users.

    Declaration

    Swift

    optional func interstitial(_ ad: GADInterstitial!, didFailToReceiveAdWithError error: Any!)

    Objective-C

    - (void)interstitial:(nonnull GADInterstitial *)ad
        didFailToReceiveAdWithError:(nonnull GADRequestError *)error;
  • Called just before presenting an interstitial. After this method finishes the interstitial will animate onto the screen. Use this opportunity to stop animations and save the state of your application in case the user leaves while the interstitial is on screen (e.g. to visit the App Store from a link on the interstitial).

    Declaration

    Swift

    optional func interstitialWillPresentScreen(_ ad: GADInterstitial!)

    Objective-C

    - (void)interstitialWillPresentScreen:(nonnull GADInterstitial *)ad;
  • Called when |ad| fails to present.

    Declaration

    Swift

    optional func interstitialDidFail(toPresentScreen ad: GADInterstitial!)

    Objective-C

    - (void)interstitialDidFailToPresentScreen:(nonnull GADInterstitial *)ad;
  • Called before the interstitial is to be animated off the screen.

    Declaration

    Swift

    optional func interstitialWillDismissScreen(_ ad: GADInterstitial!)

    Objective-C

    - (void)interstitialWillDismissScreen:(nonnull GADInterstitial *)ad;
  • Called just after dismissing an interstitial and it has animated off the screen.

    Declaration

    Swift

    optional func interstitialDidDismissScreen(_ ad: GADInterstitial!)

    Objective-C

    - (void)interstitialDidDismissScreen:(nonnull GADInterstitial *)ad;
  • Called just before the application will background or terminate because the user clicked on an ad that will launch another application (such as the App Store). The normal UIApplicationDelegate methods, like applicationDidEnterBackground:, will be called immediately before this.

    Declaration

    Swift

    optional func interstitialWillLeaveApplication(_ ad: GADInterstitial!)

    Objective-C

    - (void)interstitialWillLeaveApplication:(nonnull GADInterstitial *)ad;