CustomEventListener

public interface CustomEventListener

Known direct subclasses
CustomEventBannerListener

This interface is deprecated.

Use Adapter and MediationAdLoadCallback instead.

CustomEventInterstitialListener

This interface is deprecated.

Use Adapter and MediationAdLoadCallback instead.

CustomEventNativeListener

This interface is deprecated.

Use Adapter and MediationAdLoadCallback instead.


A base custom event listener for banner and interstitial ads. Do not implement this interface directly. Instead, implement CustomEventBannerListener and/or and/or CustomEventNativeListener.

Summary

Public methods

abstract void

Indicates that the user has clicked on this custom event.

abstract void

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

abstract void

Indicates that a custom event request has failed along with the underlying cause.

abstract void
onAdFailedToLoad(int errorCode)

This method is deprecated.

Use onAdFailedToLoad instead.

abstract void

Indicates that user interaction with the custom event is causing the device to switch to a different application (such as a web browser).

abstract void

Indicates that the custom event is rendering something that is full screen.

Public methods

onAdClicked

abstract void onAdClicked()

Indicates that the user has clicked on this custom event. 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.

onAdClosed

abstract void onAdClosed()

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

See also
onAdOpened

onAdFailedToLoad

abstract void onAdFailedToLoad(@NonNull AdError adError)

Indicates that a custom event 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 custom event must report either success or failure. If no response is received within a time limit, the Google Mobile Ads SDK moves on to another adapter, resulting in a potentially successful ad not being shown.

Parameters
@NonNull AdError adError

AdError detailing the cause of the failure.

onAdFailedToLoad

abstract void onAdFailedToLoad(int errorCode)

Indicates that a custom event 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 custom event must report either success or failure. If no response is received within a time limit, the Google Mobile Ads SDK moves on to another adapter, resulting in a potentially successful ad not being shown.

Parameters
int errorCode

An error code detailing the cause of the failure.

onAdLeftApplication

abstract void onAdLeftApplication()

Indicates that user interaction with the custom event 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.

onAdOpened

abstract void onAdOpened()

Indicates that the custom event is rendering something that is full screen. This may be an android.app.Activity, or it may be a precursor to switching to a different application.

Once this screen is dismissed, onAdClosed must be called.