GoogleMobileAds Framework Reference

Protocols

The following protocols are available globally.

  • The DFPCustomRenderedAd banner view delegate protocol for notifying the delegate of changes tocustom rendered banners.

    Declaration

    Swift

    protocolDFPCustomRenderedBannerViewDelegate:NSObjectProtocol
  • The DFPCustomRenderedAd interstitial delegate protocol for notifying the delegate of changes tocustom rendered interstitials.

    Declaration

    Swift

    protocolDFPCustomRenderedInterstitialDelegate:NSObjectProtocol
  • Base ad loader delegate protocol. Ad types provide extended protocols that declare methods tohandle successful ad loads.

    Declaration

    Swift

    protocolGADAdLoaderDelegate:NSObjectProtocol
  • An object implementing this protocol contains information set by the publisher on the clientdevice for a particular ad network.

    Ad networks should create an ‘extras’ object implementing this protocol for their publishers touse.

    Declaration

    Swift

    protocolGADAdNetworkExtras:NSObjectProtocol
  • The class implementing this protocol will be notified when the GADBannerView’s ad contentchanges size. Any views that may be affected by the banner size change will have time to adjust.

    Declaration

    Swift

    protocolGADAdSizeDelegate:NSObjectProtocol
  • Implement your app event within these methods. The delegate will be notified when the SDKreceives an app event message from the ad.

    Declaration

    Swift

    protocolGADAppEventDelegate:NSObjectProtocol
  • A set of methods to inform the delegate of audio video manager events.

    Declaration

    Swift

    protocolGADAudioVideoManagerDelegate:NSObjectProtocol
  • Delegate methods for receiving GADBannerView state change messages such as ad request statusand ad click lifecycle.

    Declaration

    Swift

    protocolGADBannerViewDelegate:NSObjectProtocol
  • The banner custom event protocol. Your banner custom event handler must implement this protocol.

    Declaration

    Swift

    protocolGADCustomEventBanner:NSObjectProtocol
  • 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 onto the next ad network.

    Declaration

    Swift

    protocolGADCustomEventBannerDelegate:NSObjectProtocol
  • The interstitial custom event protocol. Your interstitial custom event handler must implementthis protocol.

    Declaration

    Swift

    protocolGADCustomEventInterstitial:NSObjectProtocol
  • Call back to this delegate in your custom event. You must callcustomEventInterstitialDidReceiveAd: when there is an ad to show, orcustomEventInterstitial:didFailAd: when there is no ad to show. Otherwise, if enough time passed(several seconds) after the SDK called the requestInterstitialAdWithParameter: method of yourcustom event, the mediation SDK will consider the request timed out, and move on to the next adnetwork.

    Declaration

    Swift

    protocolGADCustomEventInterstitialDelegate:NSObjectProtocol
  • Native ad custom event protocol. Your native ad custom event handler class must conform to thisprotocol.

    Declaration

    Swift

    protocolGADCustomEventNativeAd:NSObjectProtocol
  • The delegate of the GADCustomEventNativeAd object must adopt the GADCustomEventNativeAdDelegateprotocol. Methods in this protocol are used for native ad’s custom event communication with theGoogle Mobile Ads SDK.

    Declaration

    Swift

    protocolGADCustomEventNativeAdDelegate:NSObjectProtocol
  • In-app purchase delegate protocol for default purchase handling. The delegate must deliverthe purchased item then call the GADDefaultInAppPurchase object’s finishTransaction method.

    Declaration

    Swift

    protocolGADDefaultInAppPurchaseDelegate:NSObjectProtocol
  • In-app purchase delegate protocol for custom purchase handling. The delegate must handle theproduct purchase flow then call the GADInAppPurchase object’s reportPurchaseStatus: method.

    Declaration

    Swift

    protocolGADInAppPurchaseDelegate:NSObjectProtocol
  • Delegate for receiving state change messages from a GADInterstitial such as interstitial adrequests succeeding/failing.

    Declaration

    Swift

    protocolGADInterstitialDelegate:NSObjectProtocol
  • Identifies native ad assets.

    Declaration

    Swift

    protocolGADNativeAdDelegate:NSObjectProtocol
  • Delegate methods for receiving GADNativeExpressAdView state change messages such as ad requeststatus and ad click lifecycle.

    Declaration

    Swift

    protocolGADNativeExpressAdViewDelegate:NSObjectProtocol
  • Delegate for receiving state change messages from a GADRewardBasedVideoAd such as ad requestssucceeding/failing.

    Declaration

    Swift

    protocolGADRewardBasedVideoAdDelegate:NSObjectProtocol
  • Delegate for receiving state change messages from a GADRewardedAd.

    Declaration

    Swift

    protocolGADRewardedAdDelegate:NSObjectProtocol
  • Delegate for receiving metadata change messages from a GADRewardedAd.

    Declaration

    Swift

    protocolGADRewardedAdMetadataDelegate:NSObjectProtocol
  • The GADVideoControllerDelegate protocol defines methods that are called by the video controllerobject in response to the video events that occurred throughout the lifetime of the videorendered by an ad.

    Declaration

    Swift

    protocolGADVideoControllerDelegate:NSObjectProtocol
  • Ad network adapter protocol.

    Declaration

    Swift

    protocolGADMAdNetworkAdapter:NSObjectProtocol
  • Ad network adapters interact with the mediation SDK using an object that implements theGADMAdNetworkConnector protocol. The connector object can be used to obtain necessaryinformation for ad requests, and to call back to the mediation SDK on ad request returns anduser interactions.

    Declaration

    Swift

    protocolGADMAdNetworkConnector:GADMediationAdRequest
  • Your adapter must conform to this protocol to provide reward based video ads.

    Declaration

    Swift

    protocolGADMRewardBasedVideoAdNetworkAdapter:NSObjectProtocol
  • Reward based video ad network adapters interact with the mediation SDK using an object thatconforms to the GADMRewardBasedVideoAdNetworkConnector protocol. The connector object can beused to obtain information for ad requests and to call back to the mediation SDK on ad responsesand user interactions.

    Declaration

    Swift

    protocolGADMRewardBasedVideoAdNetworkConnector:GADMediationAdRequest
  • Base protocol for mediated native ads.

    Declaration

    Swift

    protocolGADMediatedNativeAd:NSObjectProtocol
  • GADMediatedNativeAdDelegate objects handle mediated native ad events.

    Declaration

    Swift

    protocolGADMediatedNativeAdDelegate:NSObjectProtocol
  • Provides methods used for constructing native app install ads. The adapter must return an objectconforming to this protocol for native app install ad requests.

    Declaration

    Swift

    protocolGADMediatedNativeAppInstallAd:GADMediatedNativeAd
  • Provides methods used for constructing native ads. The adapter must return an object conformingto this protocol for native ad requests.

    Declaration

    Swift

    protocolGADMediatedUnifiedNativeAd:NSObjectProtocol
  • Rendered ad. Objects conforming to this protocol are created by the adapter and returned tothe Google Mobile Ads SDK via the adapter’s render method completion handler.

    Declaration

    Swift

    protocolGADMediationAd:NSObjectProtocol
  • Provides information which can be used for making ad requests during mediation.

    Declaration

    Swift

    protocolGADMediationAdRequest:NSObjectProtocol
  • Receives messages and requests from the Google Mobile Ads SDK. Provides GMA to 3P SDKcommunication.

    Adapters are initialized on a background queue and should avoid using the main queue untilload time.

    Declaration

    Swift

    protocolGADMediationAdapter:NSObjectProtocol
  • Rendered banner ad. Provides a single subview to add to the banner view’s view hierarchy.

    Declaration

    Swift

    protocolGADMediationBannerAd:GADMediationAd
  • Adapter that provides signals to the Google Mobile Ads SDK to be included in an OpenRTB auction.

    Declaration

    Swift

    protocolGADRTBAdapter:GADMediationAdapter

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2021-03-03 UTC.