GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADCustomEventBanner
Deprecated
Use GADMediationBannerAd and GADMediationAdapter instead.
@protocol GADCustomEventBanner <NSObject>
The banner custom event protocol. Your banner custom event handler must implement this protocol.
-
Deprecated
Use GADMediationBannerAd and GADMediationAdapter instead.
Inform |delegate| with the custom event execution results to ensure mediation behaves correctly.
In your class, define the -delegate and -setDelegate: methods or use “@synthesize delegate”. The
Google Mobile Ads SDK sets this property on instances of your class.
-
Deprecated
Use GADMediationBannerAd and GADMediationAdapter instead.
Returns an initialized custom event banner.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Deprecated
Use GADMediationBannerAd and GADMediationAdapter instead.
Called by mediation when your custom event is scheduled to be executed. Report execution results
to the delegate.
Declaration
Swift
func requestAd(_ adSize: AdSize, parameter serverParameter: String?, label serverLabel: String?, request: CustomEventRequest)
Objective-C
- (void)requestBannerAd:(GADAdSize)adSize
parameter:(nullable NSString *)serverParameter
label:(nullable NSString *)serverLabel
request:(nonnull GADCustomEventRequest *)request;
Parameters
adSize
|
The size of the ad as configured in the mediation UI for the mediation placement.
|
serverParameter
|
Parameter configured in the mediation UI.
|
serverLabel
|
Label configured in the mediation UI.
|
request
|
Contains ad request information.
|
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\u003eGADCustomEventBanner\u003c/code\u003e is deprecated and developers should use \u003ccode\u003eGADMediationBannerAd\u003c/code\u003e and \u003ccode\u003eGADMediationAdapter\u003c/code\u003e instead.\u003c/p\u003e\n"],["\u003cp\u003eThis protocol was previously used for banner custom event handlers in Google Mobile Ads mediation.\u003c/p\u003e\n"],["\u003cp\u003eThe protocol included methods for initialization, requesting banner ads with parameters, and reporting results to a delegate.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should migrate their implementations to the newer \u003ccode\u003eGADMediationBannerAd\u003c/code\u003e and \u003ccode\u003eGADMediationAdapter\u003c/code\u003e classes for continued support and functionality.\u003c/p\u003e\n"]]],["The `GADCustomEventBanner` protocol is deprecated and should be replaced with `GADMediationBannerAd` and `GADMediationAdapter`. The protocol requires implementing a delegate property to report execution results. It provides an initializer and a `requestBannerAd` method. The `requestBannerAd` method is called during custom event execution and requires reporting results to the delegate. This method takes the ad's size, server parameters, a label, and the ad request.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADCustomEventBanner\n====================\n\nDeprecated\n\nUse GADMediationBannerAd and GADMediationAdapter instead. \n\n @protocol GADCustomEventBanner \u003cNSObject\u003e\n\nThe banner custom event protocol. Your banner custom event handler must implement this protocol.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(pl)GADCustomEventBanner(py)delegate)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAd and GADMediationAdapter instead. \n Inform \\|delegate\\| with the custom event execution results to ensure mediation behaves correctly.\n\n In your class, define the -delegate and -setDelegate: methods or use \"@synthesize delegate\". The\n Google Mobile Ads SDK sets this property on instances of your class. \n\n #### Declaration\n\n Swift \n\n weak var delegate: (any ../Protocols/GADCustomEventBannerDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GADCustomEventBannerDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(pl)GADCustomEventBanner(im)init)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAd and GADMediationAdapter instead. \n Returns an initialized custom event banner. \n\n #### Declaration\n\n Swift \n\n init()\n\n Objective-C \n\n - (nonnull instancetype)init;\n\n- `\n ``\n ``\n `\n\n ### [-requestBannerAd:parameter:label:request:](#/c:objc(pl)GADCustomEventBanner(im)requestBannerAd:parameter:label:request:)\n\n `\n ` \n Deprecated\n\n Use GADMediationBannerAd and GADMediationAdapter instead. \n Called by mediation when your custom event is scheduled to be executed. Report execution results\n to the delegate. \n\n #### Declaration\n\n Swift \n\n func requestAd(_ adSize: AdSize, parameter serverParameter: String?, label serverLabel: String?, request: CustomEventRequest)\n\n Objective-C \n\n - (void)requestBannerAd:(../Structs/GADAdSize.html)adSize\n parameter:(nullable NSString *)serverParameter\n label:(nullable NSString *)serverLabel\n request:(nonnull ../Classes/GADCustomEventRequest.html *)request;\n\n #### Parameters\n\n |-------------------------|-----------------------------------------------------------------------------------|\n | ` `*adSize*` ` | The size of the ad as configured in the mediation UI for the mediation placement. |\n | ` `*serverParameter*` ` | Parameter configured in the mediation UI. |\n | ` `*serverLabel*` ` | Label configured in the mediation UI. |\n | ` `*request*` ` | Contains ad request information. |"]]