AATKit Android Integration
Release Notes
  • Start
    • Setup
      • Maven
      • Prerequisites
      • Google Family Safe Apps
    • Initialization
    • Consent
      • General Handling
      • Managed Consent
        • Google CMP
        • Sourcepoint CMP
        • SFBX (AppConsent) CMP
      • Vendor Consent
      • Simple Consent
    • Plugins documentation
    • Additional Information
  • Formats
    • Introduction
    • Banner
      • Auto Load Banner
      • Multi-Size Auto Load Banner
      • Banner Cache
      • Infeed Banner
      • Sticky Banner
      • Multi-Size Banner
    • Fullscreen (Interstitial)
    • AppOpen (Google)
    • Rewarded Video
      • Server-Side Verification (SSV)
    • Native Ad
      • Basic Integration
      • Network Specifics
        • Native Ads: Google
        • Native Ads: ApplovinMax
        • Native Ads: Bluestack
        • Native Ads: FacebookAudienceNetwork
        • Native Ads: Huawei
  • Ad Networks
    • Customize Ad Networks
    • Google Mobile Ads SDK
    • AppLovinMax Ad Review
    • AppNexus special settings
    • FeedAd Shutter Colour and Disabling Spinner
    • Kidoz
  • Advanced
    • Targeting
      • Key-Value Targeting
      • User Targeting
      • Content Targeting URL
    • Frequency Capping
    • Advanced Listeners
      • Reports Delegate
      • Impression Listener (ILRD)
      • Statistics Listener
    • AATKit's Size
    • Ad Space and Fill Rate
    • Shake Debug
    • Child-directed Support
    • Geo Tracking
    • Disabling Ad Networks
    • Huawei Support
    • Creatives History
  • Other
    • AdMob Custom Events
    • Reference
      • Classes
        • AATKit
        • AATKitUserTargeting
        • CollapsibleBannerOptions
        • AATKitDebugScreenConfiguration
        • PlacementDebugInfo
        • AATKitDebugInfo
        • AATKitConfiguration
        • AATKitRuntimeConfiguration
        • ManagedConsent
        • VendorConsent
        • SimpleConsent
        • BannerConfiguration
        • BannerRequest
        • BannerCacheConfiguration
        • AATKitReward
        • NativeAdRating
        • AATKitImpression
        • PriceInfo
        • AdInfo
        • RewardedAdSSVInfo
        • PlacementHistoryInfo
        • AATKitAdNetworkOptions
          • SuperAwesomeOptions
          • FeedAdOptions
          • AppNexusOptions
          • AdMobOptions
          • DFPOptions
      • Interfaces
        • CacheStatusDelegate
        • AATKit.Delegate
        • BannerCache
        • BannerRequestCompletionListener
        • ManagedConsentDelegate
        • VendorConsentDelegate
        • Placement
        • StickyBannerPlacement
        • StickyBannerPlacementListener
        • MultiSizeBannerPlacement
        • MultiSizeBannerPlacementListener
        • InfeedBannerPlacement
        • InfeedBannerPlacementListener
        • BannerRequestDelegate
        • CacheDelegate
        • FullscreenPlacement
        • FullscreenPlacementListener
        • AppOpenAdPlacement
        • AppOpenPlacementListener
        • RewardedVideoPlacement
        • RewardedVideoPlacementListener
        • NativeAdPlacement
        • NativePlacementListener
        • NativeAdData
        • AutoLoadBannerPlacement
        • AutoLoadBannerPlacementListener
        • AutoLoadMultiSizeBannerPlacement
        • AutoLoadMultiSizeBannerPlacementListener
        • ReportsDelegate
        • ImpressionListener
        • StatisticsListener
      • Enumerations
        • AATKitGender
        • AdNetwork
        • ManagedConsentState
        • NonIABConsent
        • BannerPlacementSize
        • BannerSize
        • MediationType
        • ImpressionPricePrecisionType
  • Samples
Powered by GitBook
On this page
  1. Other
  2. Reference
  3. Interfaces

BannerCache

interface BannerCache {
    /**
     * Sets the [impression listener][ImpressionListener] for banner cache.
     */
    var impressionListener: ImpressionListener?

    /**
     * Sets the [statistics listener][AATKit.StatisticsListener] that will be notified about placement reporting events, like counted adspace, request etc.
     */
    var statisticsListener: AATKit.StatisticsListener?

    /**
     * Setting for Google collapsible banners. Default is null, meaning disabled support for collapsible banners.
     */
    var collapsibleBannerOptions: CollapsibleBannerOptions?

    /**
     * Delegate representing the cache status.
     */
    var cacheStatusDelegate: CacheStatusDelegate?

    /**
     * Updates the configuration that will be used when requesting new banners.
     *
     * @param requestConfiguration [BannerRequest] instance. Can not be null.
     * @param shouldRefresh        True if the whole cache should be re-loaded with new banner request configuration, false if new configuration should only be used for new requests.
     */
    fun updateRequestConfiguration(requestConfiguration: BannerRequest?, shouldRefresh: Boolean)

    /**
     * Returns an instance of [BannerPlacementLayout] to be used within the app. Also automatically counts an ad space.
     *
     *
     * **BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.**
     *
     *
     * This method respects the frequency capping, set by [BannerCacheConfiguration.setMinimumDelay]
     *
     * @return [BannerPlacementLayout] instance.
     */
    fun consume(): BannerPlacementLayout?

    /**
     * Returns an instance of [BannerPlacementLayout] to be used within the app. Also automatically counts an ad space.
     * **BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.**
     *
     * @param force true if cache should try to return banner ignoring the frequency capping set by [BannerCacheConfiguration.setMinimumDelay]
     * @return [BannerPlacementLayout] instance.
     */
    fun consume(force: Boolean): BannerPlacementLayout?

    /**
     * Enables the banner creative history.
     */
    fun enableCreativeHistory(size: Int)

    /**
     * Retrieves the banner creative history (if it was enabled).
     */
    fun getCreativeHistory(): Array<PlacementHistoryInfo>?

    /**
     * Destroys the BannerCache, clearing all preloaded banner ads and canceling pending reload requests. For proper memory management, it needs to be called when the BannerCache is no longer needed.
     * **Destroyed BannerCache can no longer be used.**
     */
    fun destroy()

    /**
     * Optional delegate informing about events in BannerCache.
     */
    interface CacheDelegate {
        /**
         * Called when the first banner gets loaded for the cache. Only called once.
         */
        fun firstBannerLoaded()
    }

    /**
     * Optional delegate representing the cache status.
     */
    interface CacheStatusDelegate {
        /**
         * Will be called when the cache was empty and has been filled with at least one ad.
         */
        fun cacheIsNoLongerEmpty()

        /**
         * Will be called when the las ad from cache has been consumed and cache became (temporarily) empty.
         */
        fun cacheIsEmpty()

    }
}

Last updated 4 months ago