AdsLoader.EventListener


@UnstableApi
interface AdsLoader.EventListener


Listener for ads loader events. All methods are called on the main thread.

Summary

Public functions

Unit

Called when the user clicks through an ad (for example, following a 'learn more' link).

Unit

Called when there was an error loading ads.

Unit

Called when the ad playback state has been updated.

Unit

Called when the user taps a non-clickthrough part of an ad.

Public functions

onAdClicked

fun onAdClicked(): Unit

Called when the user clicks through an ad (for example, following a 'learn more' link).

onAdLoadError

fun onAdLoadError(error: AdsMediaSource.AdLoadException!, dataSpec: DataSpec!): Unit

Called when there was an error loading ads.

Parameters
error: AdsMediaSource.AdLoadException!

The error.

dataSpec: DataSpec!

The data spec associated with the load error.

onAdPlaybackState

fun onAdPlaybackState(adPlaybackState: AdPlaybackState!): Unit

Called when the ad playback state has been updated. The number of ad groups may not change after the first call.

Parameters
adPlaybackState: AdPlaybackState!

The new ad playback state.

onAdTapped

fun onAdTapped(): Unit

Called when the user taps a non-clickthrough part of an ad.