AATBannerCache

@objc public class AATBannerCache : NSObject {

    /// set statistics delegate
    ///
    /// ``AATStatisticsDelegate`` implementation that will be notified about statistics events.
    ///
    @objc public weak var statisticsDelegate: AATStatisticsDelegate? { get set }

    /// Setting impressions delegate
    ///
    /// Set the banner cache ``AATImpressionDelegate``
    ///
    /// ``AATImpressionDelegate`` instance
    @objc public var impressionDelegate: AATImpressionDelegate? { get set }
    
    /// Sets the placement collapsible banner options
    var collapsableBannerOptions: AATCollapsibleBannerOptions? { get set }

    /// Creates a cache of automatically preloaded banner ads.
    ///
    /// - Parameter cacheConfiguration: instance of ``AATBannerCacheConfiguration`` used to configure the cache.
    @objc public init(cacheConfiguration: AATBannerCacheConfiguration)

    /// Updates the configuration that will be used when requesting new banners.
    ///
    /// - Parameters:
    ///   - requestConfiguration: AATBannerRequest instance
    ///   - 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.
    @objc public func updateRequestConfiguration(_ requestConfiguration: AATBannerRequest, shouldRefresh: Bool)

    /// Returns an instance of ``AATBannerPlacementWrapperView`` 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.
    ///
    /// - Parameter force: true if cache should try to return banner ignoring the frequency capping set by { BannerCacheConfiguration.setMinimumDelay(int) }, default value is false
    ///
    /// - Returns: Ad View to be displayed
    @objc public func consume(force: Bool = false) -> AATBannerPlacementWrapperView?

    /// 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
    @objc public func destroy()
}

Last updated