AATKit Flutter Binding
Release Notes
  • Start
    • Setup
    • Initialization
    • Google Mobile Ads SDK
    • Consent
      • Managed Consent
  • Formats
    • Sticky Banner
    • Banner Cache
    • Fullscreen (Interstitial)
    • Rewarded Video
    • App Open Ads
  • Other
    • Events
Powered by GitBook
On this page
  • Note
  • Create Banner Cache
  • Consume Banners
  • Destroy old banner
  • Destroy no longer needed BannerCache
  • Code Example
  1. Formats

Banner Cache

Integrate banner cache

PreviousSticky BannerNextFullscreen (Interstitial)

Last updated 1 year ago

Note

Banner cache is currently only available on the branch.

Create Banner Cache

To create banner cache, call createBannerCache method:

_aatKitBinding.createBannerCache()

You can change the cache configuration if needed. Please modify corresponding variables or pass more parameters to the constructor of BannerCacheConfiguration (Android) orAATBannerCacheConfiguration (iOS):

AATKitBinding.kt
    //Change banner cache configuration if needed
    private val bannerCachePlacementName = "bannerCachePlacement"
    private val bannerCacheSize = 2
    
    ...
    
    private fun createBannerCache() {
        //Set more parameters of BannerCacheConfiguration if needed
        val configuration = BannerCacheConfiguration(bannerCachePlacementName, bannerCacheSize)
        configuration.delegate = bannerCacheListener
        bannerCache = AATKit.createBannerCache(configuration)
    }
AATKitBinding.swift
    //Change banner cache parameters if needed
    private let bannerCachePlacementName = "bannerCachePlacement"
    private let bannerCacheSize = 2
    
    ...
    
    
    private func createBannerCache() {
        //Set more parameters of AATBannerCacheConfiguration if needed
        let configuration = AATBannerCacheConfiguration(placementName: bannerCachePlacementName, size: bannerCacheSize)
        configuration.delegate = bannerCacheDelegate
        Self.bannerCache = AATSDK.createBannerCache(configuration: configuration)
    }

Consume Banners

Next banner is consumed automatically when adding AATKitBanner widget with passed type parameter as AATKitBannerType.cached:

AATKitBanner(
  type: AATKitBannerType.cached,
)

Destroy old banner

Banner is destroyed automatically when AATKitBanner widget is no longer attached to the UI.

Destroy no longer needed BannerCache

For proper memory management, BannerCache needs to be destroyed when is no longer needed. The destroyBannerCache method destroys the BannerCache:

_aatKitBinding.destroyBannerCache();

Code Example

Please see to check how banner cache is integrated within ListView widget. Please note our example app requires to call creating banner cache manually by pressing the Create banner cache button from the .

3.3-beta-release
list_page.dart
home_page.dart