GADCustomEventInterstitial

@protocol GADCustomEventInterstitial <NSObject>

The interstitial custom event protocol. Your interstitial custom event handler must implement this protocol.

  • 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: AnyObject! { get set }

    Objective-C

    @property (readwrite, nonatomic, nullable) id<GADCustomEventInterstitialDelegate>
        delegate;
  • Called by mediation when your custom event is scheduled to be executed. Your implementation should start retrieving the interstitial ad. Report execution results to the delegate. You must wait until -presentFromRootViewController is called before displaying the interstitial ad.

    Declaration

    Swift

    func requestAd(withParameter serverParameter: Any!, label serverLabel: Any!, request: Any!)

    Objective-C

    - (void)requestInterstitialAdWithParameter:(NSString *_Nullable)serverParameter
                                         label:(NSString *_Nullable)serverLabel
                                       request:
                                           (nonnull GADCustomEventRequest *)request;

    Parameters

    serverParameter

    Parameter configured in the mediation UI.

    serverLabel

    Label configured in the mediation UI.

    request

    Contains ad request information.

  • Present the interstitial ad as a modal view using the provided view controller. Called only after your class calls -customEventInterstitialDidReceiveAd: on its custom event delegate.

    Declaration

    Swift

    func present(fromRootViewController rootViewController: Any!)

    Objective-C

    - (void)presentFromRootViewController:(id)rootViewController;