MediationInterstitialListener

interface MediationInterstitialListener


Callback for an adapter to communicate back to the mediation library. Events must be communicated back for the mediation library to properly manage ad flow.

Summary

Public functions

Unit

Indicates that the user has clicked on this ad.

Unit

Indicates that the ad control rendered something in full screen and is now transferring control back to the application.

Unit

Indicates that an ad request failed to load.

Unit

This function is deprecated.

Use onAdFailedToLoad instead.

Unit

Indicates that the ad is causing the device to switch to a different application (such as a web browser).

Unit

Indicates that an ad has been requested and successfully received.

Unit

Indicates that the ad control is rendering something that is full screen.

Public functions

onAdClicked

fun onAdClicked(adapter: MediationInterstitialAdapter!): Unit

Indicates that the user has clicked on this ad. This is used for publisher metrics, and must be called in addition to any other events; this event is never inferred by the mediation library. For example, onAdLeftApplication would generally mean that the user has clicked on an ad, but onAdClicked must be called regardless.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

onAdClosed

fun onAdClosed(adapter: MediationInterstitialAdapter!): Unit

Indicates that the ad control rendered something in full screen and is now transferring control back to the application. This may be the user returning from a different application.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

See also
onAdOpened

onAdFailedToLoad

fun onAdFailedToLoad(adapter: MediationInterstitialAdapter!, adError: AdError): Unit

Indicates that an ad request failed to load.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

adError: AdError

AdError detailing the cause of the failure.

See also
onAdLoaded

onAdFailedToLoad

fun onAdFailedToLoad(adapter: MediationInterstitialAdapter!, error: Int): Unit

Indicates that an ad request has failed along with the underlying cause. A failure may be an actual error or just a lack of fill.

Once an ad is requested, the adapter must report either success or failure. If no response is heard within a time limit, the mediation library may move on to another adapter, resulting in a potentially successful ad not being shown.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

error: Int

An error code detailing the cause of the failure.

See also
onAdLoaded

onAdLeftApplication

fun onAdLeftApplication(adapter: MediationInterstitialAdapter!): Unit

Indicates that the ad is causing the device to switch to a different application (such as a web browser). This must be called before the current application is put in the background.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

onAdLoaded

fun onAdLoaded(adapter: MediationInterstitialAdapter!): Unit

Indicates that an ad has been requested and successfully received.

Once an ad is requested, the adapter must report either success or failure. If no response is heard within a time limit, the mediation library may move on to another adapter, resulting in a potentially successful ad not being shown.

From the point when this method is called until the adapter is destroyed, showInterstitial should open the interstitial.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.

See also
onAdFailedToLoad

onAdOpened

fun onAdOpened(adapter: MediationInterstitialAdapter!): Unit

Indicates that the ad control is rendering something that is full screen. This may be an , or it may be a precursor to switching to a different application.

Once this screen is dismissed, onAdClosed must be called.

Parameters
adapter: MediationInterstitialAdapter!

The mediation adapter which raised the event.