AdListener

abstract class AdListener


A listener for receiving notifications during the lifecycle of an ad.

Summary

Public constructors

Public functions

Unit

Called when a click is recorded for an ad.

Unit

Called when the user is about to return to the application after clicking on an ad.

Unit

Called when an ad request failed.

Unit

Called when an impression is recorded for an ad.

Unit

Called when an ad is received.

Unit

Called when an ad opens an overlay that covers the screen.

Unit

Called when a swipe gesture on an ad is recorded as a click.

Public constructors

AdListener

AdListener()

Public functions

onAdClicked

fun onAdClicked(): Unit

Called when a click is recorded for an ad.

onAdClosed

fun onAdClosed(): Unit

Called when the user is about to return to the application after clicking on an ad.

onAdFailedToLoad

fun onAdFailedToLoad(adError: LoadAdError!): Unit

Called when an ad request failed.

Parameters
adError: LoadAdError!

error information about the failure. getCode is one of the error code constants defined in AdRequest.

onAdImpression

fun onAdImpression(): Unit

Called when an impression is recorded for an ad.

onAdLoaded

fun onAdLoaded(): Unit

Called when an ad is received.

onAdOpened

fun onAdOpened(): Unit

Called when an ad opens an overlay that covers the screen.

onAdSwipeGestureClicked

fun onAdSwipeGestureClicked(): Unit

Called when a swipe gesture on an ad is recorded as a click. Currently available for native ads on allowlisted accounts only. Reach out to your account manager to be allowlisted for this feature.