AdCallback

interface AdCallback

AdCallback The interface which all Chartboost ad callbacks inherit from. Provides methods to receive notifications related to an ad's actions and to control its behavior.

Inheritors

Functions

Link copied to clipboard
abstract fun onAdClicked(event: ClickEvent, error: ClickError?)

Called after an ad has been clicked. Implement this method to be notified when an ad has been clicked. If the click does not result in the opening of a link, an error will be provided explaining why.

Link copied to clipboard
open fun onAdExpired(event: ExpirationEvent)

Called when a previously cached ad expires or is removed from the cache. This can happen due to TTL expiry, cache size limits (LRU eviction), explicit eviction calls, or cache clearing.

Link copied to clipboard
abstract fun onAdLoaded(event: CacheEvent, error: CacheError?)

Called after a cache call, either if an ad has been successfully loaded from the Chartboost servers and cached, or if it failed to load. Implement this method to be notified when an ad is ready to be shown after the cache method has been called.

Link copied to clipboard
abstract fun onAdRequestedToShow(event: ShowEvent)

Called after a show call, right before an ad is presented. Implement this method to be notified when an ad is about to be presented.

Link copied to clipboard
abstract fun onAdShown(event: ShowEvent, error: ShowError?)

Called after a show call, either if the ad has been presented and an ad impression logged, or if the operation failed. Implement this method to be notified when the ad presentation process has finished. This method will be called once for each call to show on an interstitial or rewarded ad. In contrast, this may be called multiple times after showing a banner, either if some error occurs after the ad has been successfully shown or as a result of the banner's automatic content refresh.

Link copied to clipboard

Called after an ad has recorded an impression. Implement this method to be notified when an ad has recorded an impression. This method will be called once a valid impression is recorded after showing the ad.