GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADCustomEventBannerDelegate
Deprecated
Use GADMediationBannerAdEventDelegate instead.
@protocol GADCustomEventBannerDelegate <NSObject>
Call back to this delegate in your custom event. You must call customEventBanner:didReceiveAd:
when there is an ad to show, or customEventBanner:didFailAd: when there is no ad to show.
Otherwise, if enough time passed (several seconds) after the SDK called the requestBannerAd:
method of your custom event, the mediation SDK will consider the request timed out, and move on
to the next ad network.
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event object must call this when it receives or creates an ad view.
Declaration
Objective-C
- (void)customEventBanner:(nonnull id<GADCustomEventBanner>)customEvent
didReceiveAd:(nonnull UIView *)view;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event object must call this when it fails to receive or create the ad view. Pass
along any error object sent from the ad network’s SDK, or an NSError describing the error. Pass
nil if not available.
Declaration
Swift
func customEventBanner(_ customEvent: any GADCustomEventBanner, didFailAd error: (any Error)?)
Objective-C
- (void)customEventBanner:(nonnull id<GADCustomEventBanner>)customEvent
didFailAd:(nullable NSError *)error;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event object should call this when the user touches or “clicks” the ad to initiate
an action. When the SDK receives this callback, it reports the click back to the mediation
server.
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
The rootViewController that you set in GADBannerView. Use this UIViewController to show a modal
view when a user taps on the ad.
Declaration
Swift
var viewControllerForPresentingModalView: UIViewController { get }
Objective-C
@property (nonatomic, readonly, nonnull) UIViewController *viewControllerForPresentingModalView;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event should call this when the user taps an ad and a modal view appears.
Declaration
Objective-C
- (void)customEventBannerWillPresentModal:
(nonnull id<GADCustomEventBanner>)customEvent;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event should call this when the user dismisses the modal view and the modal view is
about to go away.
Declaration
Objective-C
- (void)customEventBannerWillDismissModal:
(nonnull id<GADCustomEventBanner>)customEvent;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Your Custom Event should call this when the user dismisses the modal view and the modal view has
gone away.
Declaration
Objective-C
- (void)customEventBannerDidDismissModal:
(nonnull id<GADCustomEventBanner>)customEvent;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Deprecated. Use customEventBannerWasClicked:.
Declaration
Swift
func customEventBanner(_ customEvent: any GADCustomEventBanner, clickDidOccurInAd view: UIView)
Objective-C
- (void)customEventBanner:(nonnull id<GADCustomEventBanner>)customEvent
clickDidOccurInAd:(nonnull UIView *)view;
-
Deprecated
Use GADMediationBannerAdEventDelegate instead.
Deprecated. No replacement.
Declaration
Objective-C
- (void)customEventBannerWillLeaveApplication:
(nonnull id<GADCustomEventBanner>)customEvent;
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\u003eGADCustomEventBannerDelegate\u003c/code\u003e is deprecated and developers should use \u003ccode\u003eGADMediationBannerAdEventDelegate\u003c/code\u003e instead.\u003c/p\u003e\n"],["\u003cp\u003eCustom Event objects must inform the delegate about ad successes or failures using \u003ccode\u003edidReceiveAd:\u003c/code\u003e or \u003ccode\u003edidFailAd:\u003c/code\u003e respectively.\u003c/p\u003e\n"],["\u003cp\u003eClick interactions, modal view presentations, and dismissals should be communicated through corresponding delegate methods.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eviewControllerForPresentingModalView\u003c/code\u003e property provides the root view controller for presenting modal views.\u003c/p\u003e\n"]]],["The `GADCustomEventBannerDelegate` protocol, now deprecated in favor of `GADMediationBannerAdEventDelegate`, requires custom event objects to signal ad reception or failure via `customEventBanner:didReceiveAd:` or `customEventBanner:didFailAd:`. It also allows for signaling user ad interaction like clicks with `customEventBannerWasClicked:`. Additionally, it manages modal view presentation with `viewControllerForPresentingModalView` and modal life cycle events. The protocol also includes legacy click and leaving app signals. If no response from the custom event it times out.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADCustomEventBannerDelegate\n============================\n\nDeprecated\n\nUse GADMediationBannerAdEventDelegate instead. \n\n @protocol GADCustomEventBannerDelegate \u003cNSObject\u003e\n\nCall back to this delegate in your custom event. You must call customEventBanner:didReceiveAd:\nwhen there is an ad to show, or customEventBanner:didFailAd: when there is no ad to show.\nOtherwise, if enough time passed (several seconds) after the SDK called the requestBannerAd:\nmethod of your custom event, the mediation SDK will consider the request timed out, and move on\nto the next ad network.\n- `\n ``\n ``\n `\n\n ### [-customEventBanner:didReceiveAd:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBanner:didReceiveAd:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event object must call this when it receives or creates an ad view. \n\n #### Declaration\n\n Swift \n\n func customEventBanner(_ customEvent: any ../Protocols/GADCustomEventBanner.html, didReceiveAd view: UIView)\n\n Objective-C \n\n - (void)customEventBanner:(nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent\n didReceiveAd:(nonnull UIView *)view;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBanner:didFailAd:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBanner:didFailAd:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event object must call this when it fails to receive or create the ad view. Pass\n along any error object sent from the ad network's SDK, or an NSError describing the error. Pass\n nil if not available. \n\n #### Declaration\n\n Swift \n\n func customEventBanner(_ customEvent: any ../Protocols/GADCustomEventBanner.html, didFailAd error: (any Error)?)\n\n Objective-C \n\n - (void)customEventBanner:(nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent\n didFailAd:(nullable NSError *)error;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBannerWasClicked:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBannerWasClicked:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event object should call this when the user touches or \"clicks\" the ad to initiate\n an action. When the SDK receives this callback, it reports the click back to the mediation\n server. \n\n #### Declaration\n\n Swift \n\n func customEventBannerWasClicked(_ customEvent: any ../Protocols/GADCustomEventBanner.html)\n\n Objective-C \n\n - (void)customEventBannerWasClicked:\n (nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent;\n\n- `\n ``\n ``\n `\n\n ### [viewControllerForPresentingModalView](#/c:objc(pl)GADCustomEventBannerDelegate(py)viewControllerForPresentingModalView)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n The rootViewController that you set in GADBannerView. Use this UIViewController to show a modal\n view when a user taps on the ad. \n\n #### Declaration\n\n Swift \n\n var viewControllerForPresentingModalView: UIViewController { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nonnull) UIViewController *viewControllerForPresentingModalView;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBannerWillPresentModal:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBannerWillPresentModal:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event should call this when the user taps an ad and a modal view appears. \n\n #### Declaration\n\n Swift \n\n func customEventBannerWillPresentModal(_ customEvent: any ../Protocols/GADCustomEventBanner.html)\n\n Objective-C \n\n - (void)customEventBannerWillPresentModal:\n (nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBannerWillDismissModal:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBannerWillDismissModal:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event should call this when the user dismisses the modal view and the modal view is\n about to go away. \n\n #### Declaration\n\n Swift \n\n func customEventBannerWillDismissModal(_ customEvent: any ../Protocols/GADCustomEventBanner.html)\n\n Objective-C \n\n - (void)customEventBannerWillDismissModal:\n (nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBannerDidDismissModal:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBannerDidDismissModal:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Your Custom Event should call this when the user dismisses the modal view and the modal view has\n gone away. \n\n #### Declaration\n\n Swift \n\n func customEventBannerDidDismissModal(_ customEvent: any ../Protocols/GADCustomEventBanner.html)\n\n Objective-C \n\n - (void)customEventBannerDidDismissModal:\n (nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent;\n\n[Deprecated\n----------](#/Deprecated)\n\n- `\n ``\n ``\n `\n\n ### [-customEventBanner:clickDidOccurInAd:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBanner:clickDidOccurInAd:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Deprecated. Use customEventBannerWasClicked:. \n\n #### Declaration\n\n Swift \n\n func customEventBanner(_ customEvent: any ../Protocols/GADCustomEventBanner.html, clickDidOccurInAd view: UIView)\n\n Objective-C \n\n - (void)customEventBanner:(nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent\n clickDidOccurInAd:(nonnull UIView *)view;\n\n- `\n ``\n ``\n `\n\n ### [-customEventBannerWillLeaveApplication:](#/c:objc(pl)GADCustomEventBannerDelegate(im)customEventBannerWillLeaveApplication:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAdEventDelegate instead. \n Deprecated. No replacement. \n\n #### Declaration\n\n Swift \n\n func customEventBannerWillLeaveApplication(_ customEvent: any ../Protocols/GADCustomEventBanner.html)\n\n Objective-C \n\n - (void)customEventBannerWillLeaveApplication:\n (nonnull id\u003c../Protocols/GADCustomEventBanner.html\u003e)customEvent;"]]