CustomEventBanner

public interfaceCustomEventBannerimplementsCustomEvent

This interface is deprecated.
UseAdapter instead.

A custom event to support banner ads.

The typical life-cycle for a custom event is to have requestBannerAd(Context, CustomEventBannerListener, String, AdSize, MediationAdRequest, Bundle)called once. At this point the adapter should create aViewand report to the CustomEventBannerListenereither CustomEventBannerListener.onAdLoaded(View)or CustomEventListener.onAdFailedToLoad(AdError).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 requestBannerAd(Context, CustomEventBannerListener, String, AdSize, 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 adapter is expected to expose events via the CustomEventBannerListenerpassed in the requestBannerAd(Context, CustomEventBannerListener, String, AdSize, MediationAdRequest, Bundle)call. All parameters necessary to make an ad request should be passed in theserverParameter,MediationAdRequest, andcustomEventExtrasparameters.

Public Method Summary

abstract void
requestBannerAd(Context context, CustomEventBannerListenerlistener,String serverParameter,AdSizesize, MediationAdRequestmediationAdRequest,Bundle customEventExtras)
Called by the mediation library to request a view from the custom event.

Inherited Method Summary

Public Methods

public abstract voidrequestBannerAd(Contextcontext, CustomEventBannerListenerlistener,StringserverParameter, AdSizesize, MediationAdRequest mediationAdRequest,Bundle customEventExtras)

Called by the mediation library to request a view from the custom event.

If the request is successful, CustomEventBannerListener.onAdLoaded(View)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 the AdView which will contain the custom eventView.An Activity 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.
size The size of the view to fetch. The size of the view should be as close as possible to the size specified in this parameter. If this view size is not supported, the request should fail and CustomEventListener.onAdFailedToLoad(AdError)should be called.
mediationAdRequest Generic targeting parameters to use when requesting a view.
customEventExtras ABundleof parameters set by the publisher on a per-request basis.