To discuss and provide feedback on our products, join the official AdMob Discord channel in the Google Advertising and Measurement Community server.

GoogleMobileAds Framework Reference

  • The GADCustomEventBanner protocol is deprecated and should be replaced with GADMediationBannerAd and GADMediationAdapter.

  • The delegate property is used to inform the delegate of custom event execution results.

  • The -init method returns an initialized custom event banner.

  • The -requestBannerAd:parameter:label:request: method is called when the custom event is scheduled to be executed and requires reporting results to the delegate.

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.

    Declaration

    Swift

    weak var delegate: (any GADCustomEventBannerDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) id<GADCustomEventBannerDelegate> delegate;
  • Deprecated

    Use GADMediationBannerAd and GADMediationAdapter instead.

    Returns an initialized custom event banner.

    Declaration

    Swift

    init()

    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.