GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
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
@MainActor 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 availability (for example, no fill).
Declaration
Swift
@MainActor optional func bannerView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: any 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
@MainActor optional func bannerViewDidRecordImpression(_ bannerView: GADBannerView)
Objective-C
- (void)bannerViewDidRecordImpression:(nonnull GADBannerView *)bannerView;
-
Tells the delegate that a click has been recorded for the ad.
Declaration
Swift
@MainActor optional func bannerViewDidRecordClick(_ bannerView: GADBannerView)
Objective-C
- (void)bannerViewDidRecordClick:(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
@MainActor 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
@MainActor 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
@MainActor optional func bannerViewDidDismissScreen(_ bannerView: GADBannerView)
Objective-C
- (void)bannerViewDidDismissScreen:(nonnull GADBannerView *)bannerView;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADBannerViewDelegate\u003c/code\u003e provides methods to handle ad request lifecycle events, such as receiving an ad or encountering an error.\u003c/p\u003e\n"],["\u003cp\u003eIt includes delegate methods to track ad impressions and clicks, allowing developers to monitor ad performance.\u003c/p\u003e\n"],["\u003cp\u003eThe delegate also offers methods to manage the presentation and dismissal of full-screen views triggered by ad interactions.\u003c/p\u003e\n"],["\u003cp\u003eThese methods provide developers with control over the ad experience, including pausing and resuming app activities during ad interactions.\u003c/p\u003e\n"],["\u003cp\u003eThe delegate uses \u003ccode\u003eGADBannerView\u003c/code\u003e instances to relay information about specific banner ad views.\u003c/p\u003e\n"]]],[],null,["# GoogleMobileAds Framework Reference\n\nGADBannerViewDelegate\n=====================\n\n @protocol GADBannerViewDelegate \u003cNSObject\u003e\n\nDelegate methods for receiving GADBannerView state change messages such as ad request status\nand ad click lifecycle.\n[Ad Request Lifecycle Notifications\n----------------------------------](#/Ad-Request-Lifecycle-Notifications)\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewDidReceiveAd:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewDidReceiveAd:)\n\n `\n ` \n Tells the delegate that an ad request successfully received an ad. The delegate may want to add\n the banner view to the view hierarchy if it hasn't been added yet. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewDidReceiveAd(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewDidReceiveAd:(nonnull ../Classes/GADBannerView.html *)bannerView;\n\n- `\n ``\n ``\n `\n\n ### [-bannerView:didFailToReceiveAdWithError:](#/c:objc(pl)GADBannerViewDelegate(im)bannerView:didFailToReceiveAdWithError:)\n\n `\n ` \n Tells the delegate that an ad request failed. The failure is normally due to network\n connectivity or ad availability (for example, no fill). \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerView(_ bannerView: ../Classes/GADBannerView.html, didFailToReceiveAdWithError error: any Error)\n\n Objective-C \n\n - (void)bannerView:(nonnull ../Classes/GADBannerView.html *)bannerView\n didFailToReceiveAdWithError:(nonnull NSError *)error;\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewDidRecordImpression:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewDidRecordImpression:)\n\n `\n ` \n Tells the delegate that an impression has been recorded for an ad. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewDidRecordImpression(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewDidRecordImpression:(nonnull ../Classes/GADBannerView.html *)bannerView;\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewDidRecordClick:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewDidRecordClick:)\n\n `\n ` \n Tells the delegate that a click has been recorded for the ad. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewDidRecordClick(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewDidRecordClick:(nonnull ../Classes/GADBannerView.html *)bannerView;\n\n[Click-Time Lifecycle Notifications\n----------------------------------](#/Click-Time-Lifecycle-Notifications)\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewWillPresentScreen:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewWillPresentScreen:)\n\n `\n ` \n Tells the delegate that a full screen view will be presented in response to the user clicking on\n an ad. The delegate may want to pause animations and time sensitive interactions. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewWillPresentScreen(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewWillPresentScreen:(nonnull ../Classes/GADBannerView.html *)bannerView;\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewWillDismissScreen:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewWillDismissScreen:)\n\n `\n ` \n Tells the delegate that the full screen view will be dismissed. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewWillDismissScreen(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewWillDismissScreen:(nonnull ../Classes/GADBannerView.html *)bannerView;\n\n- `\n ``\n ``\n `\n\n ### [-bannerViewDidDismissScreen:](#/c:objc(pl)GADBannerViewDelegate(im)bannerViewDidDismissScreen:)\n\n `\n ` \n Tells the delegate that the full screen view has been dismissed. The delegate should restart\n anything paused while handling bannerViewWillPresentScreen:. \n\n #### Declaration\n\n Swift \n\n @MainActor optional func bannerViewDidDismissScreen(_ bannerView: ../Classes/GADBannerView.html)\n\n Objective-C \n\n - (void)bannerViewDidDismissScreen:(nonnull ../Classes/GADBannerView.html *)bannerView;"]]