GoogleMobileAds Framework Reference

GADBannerViewDelegate

@protocol GADBannerViewDelegate <NSObject>

Delegate methods for receiving GADBannerView state change messages such as ad request status and ad click lifecycle.

  • Tells the delegate that an ad request successfully received an ad. The delegate may want to add the banner view to the view hierarchy if it hasn’t been added yet.

    Declaration

    Swift

    optional func bannerViewDidReceiveAd(_ bannerView: GADBannerView)

    Objective-C

    - (void)bannerViewDidReceiveAd:(nonnull GADBannerView *)bannerView;
  • Tells the delegate that an ad request failed. The failure is normally due to network connectivity or ad availablility (i.e., no fill).

    Declaration

    Swift

    optional func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: Error)

    Objective-C

    - (void)bannerView:(nonnull GADBannerView *)bannerView
        didFailToReceiveAdWithError:(nonnull NSError *)error;
  • Tells the delegate that an impression has been recorded for an ad.

    Declaration

    Swift

    optional func bannerViewDidRecordImpression(_ bannerView: GADBannerView)

    Objective-C

    - (void)bannerViewDidRecordImpression:(nonnull GADBannerView *)bannerView;
  • Tells the delegate that a full screen view will be presented in response to the user clicking on an ad. The delegate may want to pause animations and time sensitive interactions.

    Declaration

    Swift

    optional func bannerViewWillPresentScreen(_ bannerView: GADBannerView)

    Objective-C

    - (void)bannerViewWillPresentScreen:(nonnull GADBannerView *)bannerView;
  • Tells the delegate that the full screen view will be dismissed.

    Declaration

    Swift

    optional func bannerViewWillDismissScreen(_ bannerView: GADBannerView)

    Objective-C

    - (void)bannerViewWillDismissScreen:(nonnull GADBannerView *)bannerView;
  • Tells the delegate that the full screen view has been dismissed. The delegate should restart anything paused while handling bannerViewWillPresentScreen:.

    Declaration

    Swift

    optional func bannerViewDidDismissScreen(_ bannerView: GADBannerView)

    Objective-C

    - (void)bannerViewDidDismissScreen:(nonnull GADBannerView *)bannerView;