Protocols

The following protocols are available globally.

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

    Declaration

    Objective-C

    @protocol DFPCustomRenderedBannerViewDelegate <NSObject>
  • The DFPCustomRenderedAd interstitial delegate protocol for notifying the delegate of changes to custom rendered interstitials.

    Declaration

    Objective-C

    @protocol DFPCustomRenderedInterstitialDelegate <NSObject>
  • Base ad loader delegate protocol. Ad types provide extended protocols that declare methods to handle successful ad loads.

    Declaration

    Objective-C

    @protocol GADAdLoaderDelegate <NSObject>
  • An object implementing this protocol contains information set by the publisher on the client device for a particular ad network.

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

    Declaration

    Objective-C

    @protocol GADAdNetworkExtras <NSObject>
  • The class implementing this protocol will be notified when the DFPBannerView changes ad size. Any views that may be affected by the banner size change will have time to adjust.

    Declaration

    Objective-C

    @protocol GADAdSizeDelegate <NSObject>
  • Implement your app event within these methods. The delegate will be notified when the SDK receives an app event message from the ad.

    Declaration

    Objective-C

    @protocol GADAppEventDelegate <NSObject>
  • Undocumented

    Declaration

    Objective-C

    @protocol GADAudioVideoManagerDelegate<NSObject>
    
    @optional
    
    /// Tells the delegate that the Google Mobile Ads SDK will start playing a video. This method isn't
    /// called if another video rendered by Google Mobile Ads SDK is already playing.
    - (void)audioVideoManagerWillPlayVideo:(GADAudioVideoManager *)audioVideoManager;
    
    /// Tells the delegate that the Google Mobile Ads SDK has paused/stopped all video playback.
    - (void)audioVideoManagerDidPauseAllVideo:(GADAudioVideoManager *)audioVideoManager;
    
    /// Tells the delegate that at least one video rendered by the Google Mobile Ads SDK will play
    /// sound. Your app should stop playing sound when this method is called.
    - (void)audioVideoManagerWillPlayAudio:(GADAudioVideoManager *)audioVideoManager;
    
    /// Tells the delegate that all the video rendered by the Google Mobile Ads SDK has stopped playing
    /// sound. Your app can now resume any music playback or produce any kind of sound. Note that this
    /// message doesn't mean that all the video has stopped playing, just audio, so you shouldn't
    /// deactivate AVAudioSession's instance. Doing so can lead to unexpected video playback behavior.
    /// You may deactivate AVAudioSession only when all rendered video ads are paused or have finished
    /// playing, and 'audioVideoDidPauseAllVideo:' is called.
    - (void)audioVideoManagerDidStopPlayingAudio:(GADAudioVideoManager *)audioVideoManager;
    
    @end
  • Delegate methods for receiving GADBannerView state change messages such as ad request status and ad click lifecycle.

    Declaration

    Objective-C

    @protocol GADBannerViewDelegate <NSObject>
  • The banner custom event protocol. Your banner custom event handler must implement this protocol.

    Declaration

    Objective-C

    @protocol GADCustomEventBanner <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.

    Declaration

    Objective-C

    @protocol GADCustomEventBannerDelegate <NSObject>
  • The interstitial custom event protocol. Your interstitial custom event handler must implement this protocol.

    Declaration

    Objective-C

    @protocol GADCustomEventInterstitial <NSObject>
  • Call back to this delegate in your custom event. You must call customEventInterstitialDidReceiveAd: when there is an ad to show, or customEventInterstitial:didFailAd: when there is no ad to show. Otherwise, if enough time passed (several seconds) after the SDK called the requestInterstitialAdWithParameter: method of your custom event, the mediation SDK will consider the request timed out, and move on to the next ad network.

    Declaration

    Objective-C

    @protocol GADCustomEventInterstitialDelegate <NSObject>
  • Native ad custom event protocol. Your native ad custom event handler class must conform to this protocol.

    Declaration

    Objective-C

    @protocol GADCustomEventNativeAd <NSObject>
  • The delegate of the GADCustomEventNativeAd object must adopt the GADCustomEventNativeAdDelegate protocol. Methods in this protocol are used for native ad’s custom event communication with the Google Mobile Ads SDK.

    Declaration

    Objective-C

    @protocol GADCustomEventNativeAdDelegate <NSObject>
  • In-app purchase delegate protocol for default purchase handling. The delegate must deliver the purchased item then call the GADDefaultInAppPurchase object’s finishTransaction method.

    Declaration

    Objective-C

    @protocol GADDefaultInAppPurchaseDelegate <NSObject>
  • In-app purchase delegate protocol for custom purchase handling. The delegate must handle the product purchase flow then call the GADInAppPurchase object’s reportPurchaseStatus: method.

    Declaration

    Objective-C

    @protocol GADInAppPurchaseDelegate <NSObject>
  • Delegate for receiving state change messages from a GADInterstitial such as interstitial ad requests succeeding/failing.

    Declaration

    Objective-C

    @protocol GADInterstitialDelegate <NSObject>
  • Identifies native ad assets.

    Declaration

    Objective-C

    @protocol GADNativeAdDelegate <NSObject>
  • Delegate methods for receiving GADNativeExpressAdView state change messages such as ad request status and ad click lifecycle.

    Declaration

    Objective-C

    @protocol GADNativeExpressAdViewDelegate <NSObject>
  • Delegate for receiving state change messages from a GADRewardBasedVideoAd such as ad requests succeeding/failing.

    Declaration

    Objective-C

    @protocol GADRewardBasedVideoAdDelegate <NSObject>
  • Undocumented

    Declaration

    Objective-C

    @protocol GADUnifiedNativeAdUnconfirmedClickDelegate<NSObject>
    
    /// Tells the delegate that native ad receives an unconfirmed click on view with asset ID. You
    /// should update user interface and ask user to confirm the click once this message is received.
    /// Use the -registerClickConfirmingView: method in GADNUnifiedNativeAd+ConfirmationClick.h to
    /// register a view that will confirm the click. Only called for Google ads and is not supported for
    /// mediated ads.
    - (void)nativeAd:(GADUnifiedNativeAd *)nativeAd
        didReceiveUnconfirmedClickOnAssetID:(GADUnifiedNativeAssetIdentifier)assetID;
    
    /// Tells the delegate that the unconfirmed click is cancelled. You should revert the user interface
    /// change once this message is received. Only called for Google ads and is not supported for
    /// mediated ads.
    - (void)nativeAdDidCancelUnconfirmedClick:(GADUnifiedNativeAd *)nativeAd;
    
    @end
  • The GADVideoControllerDelegate protocol defines methods that are called by the video controller object in response to the video events that occured throught the lifetime of the video rendered by an ad.

    Declaration

    Objective-C

    @protocol GADVideoControllerDelegate <NSObject>
  • Ad network adapter protocol.

    Declaration

    Objective-C

    @protocol GADMAdNetworkAdapter <NSObject>
  • Ad network adapters interact with the mediation SDK using an object that implements the GADMAdNetworkConnector protocol. The connector object can be used to obtain necessary information for ad requests, and to call back to the mediation SDK on ad request returns and user interactions.

    Declaration

    Objective-C

    @protocol GADMAdNetworkConnector <GADMediationAdRequest>
  • Your adapter must conform to this protocol to provide reward based video ads.

    Declaration

    Objective-C

    @protocol GADMRewardBasedVideoAdNetworkAdapter <NSObject>
  • Reward based video ad network adapters interact with the mediation SDK using an object that conforms to the GADMRewardBasedVideoAdNetworkConnector protocol. The connector object can be used to obtain information for ad requests and to call back to the mediation SDK on ad responses and user interactions.

    Declaration

    Objective-C

    @protocol GADMRewardBasedVideoAdNetworkConnector <GADMediationAdRequest>
  • Base protocol for mediated native ads.

    Declaration

    Objective-C

    @protocol GADMediatedNativeAd <NSObject>
  • GADMediatedNativeAdDelegate objects handle mediated native ad events.

    Declaration

    Objective-C

    @protocol GADMediatedNativeAdDelegate <NSObject>
  • Provides methods used for constructing native app install ads. The adapter must return an object conforming to this protocol for native app install requests.

    Declaration

    Objective-C

    @protocol GADMediatedNativeAppInstallAd <GADMediatedNativeAd>
  • Provides methods used for constructing native ads. The adapter must return an object conforming to this protocol for native ad requests.

    Declaration

    Objective-C

    @protocol GADMediatedUnifiedNativeAd <NSObject>
  • Provides information which can be used for making ad requests during mediation.

    Declaration

    Objective-C

    @protocol GADMediationAdRequest <NSObject>