CustomEventInterstitial

public interfaceCustomEventInterstitialimplementsCustomEvent

This interface is deprecated.
UseAdapter instead.

A custom event that supports interstitial ads.

The typical life-cycle for a custom event is to have requestInterstitialAd(Context, CustomEventInterstitialListener, String, MediationAdRequest, Bundle)called once. At this point the adapter should request an ad and report either CustomEventInterstitialListener.onAdLoaded()or CustomEventListener.onAdFailedToLoad(AdError)to the listener. Subsequent requests will be made with a new instance of the custom event. At the end of the life cycle, a best effort is made to call CustomEvent.onDestroy(),though this is not guaranteed. Note that requestInterstitialAd(Context, CustomEventInterstitialListener, String, MediationAdRequest, Bundle)is called on the UI thread so all the standard precautions of writing code on that thread apply. In particular, the code should not call any blocking methods.

The custom event is expected to forward events via the CustomEventInterstitialListenerpassed in the requestInterstitialAd(Context, CustomEventInterstitialListener, String, MediationAdRequest, Bundle)call. All parameters necessary to make an ad request should be passed in theserverParameter,MediationAdRequest, andcustomEventExtrasparameters.

Public Method Summary

abstract void
requestInterstitialAd(Context context, CustomEventInterstitialListenerlistener,String serverParameter, MediationAdRequestmediationAdRequest,Bundle customEventExtras)
Called by the mediation library to request an interstitial.
abstract void
showInterstitial()
Show the interstitial.

Inherited Method Summary

Public Methods

public abstract voidrequestInterstitialAd(Contextcontext, CustomEventInterstitialListenerlistener,StringserverParameter, MediationAdRequest mediationAdRequest,Bundle customEventExtras)

Called by the mediation library to request an interstitial.

If the request is successful, CustomEventInterstitialListener.onAdLoaded()should be called.

If the request is unsuccessful, CustomEventListener.onAdFailedToLoad(AdError)should be called on the listenerwith an appropriate error cause.

This method is called on the UI thread so all the standard precautions of writing code on that thread apply. In particular your code should not call any blocking methods.

Parameters
context TheContext of theInterstitialAd that requested the custom event interstitial. AnActivity is preferred.
listener Listener to custom event with callbacks for various events.
serverParameter The string configured in the publisher UI as the parameter for the custom event.
mediationAdRequest Generic targeting parameters to use when requesting an interstitial.
customEventExtras ABundleof parameters set by the publisher on a per-request basis.

public abstract voidshowInterstitial()

Show the interstitial. This may be called any time after a call to CustomEventInterstitialListener.onAdLoaded().