onAdLoaded

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.

A typical implementation would look like this:

fun onAdLoaded(event: CacheEvent, error: CacheError?) {
if (error != null) {
// Handle error
} else {
// At this point event.ad.isCached will be true, and the ad is ready to be shown.
}
}

Parameters

event

A cache event with information related to the cached ad.

error

An error specifying the failure reason, or null if the operation was successful.