Adapter for third party ad networks that support interstitial ads.
The typical life-cycle for an adapter is to have
requestInterstitialAd(Context, MediationInterstitialListener, Bundle, MediationAdRequest, Bundle) called once.
At this point the adapter should request an ad from the ad network and report to the listener
onAdFailedToLoad(MediationInterstitialAdapter, int). Subsequent requests will be made
with a new instance of the adapter. At the end of the life cycle, a best effort is made to call
onDestroy(), though this is not guaranteed. Note that
requestInterstitialAd(Context, MediationInterstitialListener, Bundle, 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 forward events via the
requestInterstitialAd(Context, MediationInterstitialListener, Bundle, MediationAdRequest, Bundle) call. All parameters necessary to make an ad request
should be passed in the
Adapters should make an effort to disable automatic ad refreshing on the client side. Ads that are refreshed may be ignored, not displayed, and counted incorrectly.
Public Method Summary
Shows the interstitial.
Inherited Method Summary
public abstract void requestInterstitialAd (Context context, MediationInterstitialListener listener, Bundle serverParameters, MediationAdRequest mediationAdRequest, Bundle mediationExtras)
Called by the mediation library to request an ad from the adapter.
If the request is successful, the
onAdLoaded(MediationInterstitialAdapter) method should be called. The interstitial
should *NOT* be automatically shown at this point. The mediation library will call the
showInterstitial() method when the interstitial should be shown.
If the request is unsuccessful, the
onAdFailedToLoad(MediationInterstitialAdapter, int) method should be called on the
listener with an appropriate error cause.
Note that this method is called on the UI thread, so all the general precautions of writing code on that thread apply. In particular, the code should not call any blocking methods.
|listener||Listener to adapter with callbacks for various events|
|serverParameters||Additional parameters defined by the publisher on the mediation server side|
|mediationAdRequest||Generic parameters for this publisher to use when making his ad request|
|mediationExtras||Additional parameters set by the publisher on a per-request basis|