AATBannerCache
@objc
public protocol AATBannerCache: AnyObject {
/// Sets the placement statistics delegate
var statisticsDelegate: AATStatisticsDelegate? { get set }
/// Sets the placement impression delegate
var impressionDelegate: AATImpressionDelegate? { get set }
/// The delegate that represents the cache status
var cacheStatusDelegate: AATBannerCacheStatusDelegate? { get set }
var collapsableBannerOptions: AATCollapsibleBannerOptions? { get set }
/// 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.
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 ``AATBannerCacheConfiguration/minDelay``.
///
/// - Returns: Ad View to be displayed.
func consume(force: Bool) -> AATBannerPlacementWrapperView?
/// Returns an instance of ``AATBannerPlacementWrapperView`` to be used within the app. Also automatically counts an ad space. It will respect the frequency capping set by ``AATBannerCacheConfiguration/minDelay``.
///
/// BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.
///
/// - Returns: Ad View to be displayed.
func consume() -> 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
func destroy()
/// Enable saving creative history
/// - Parameter size: The max size of the history to be saved
func enableCreativeHistory(size: Int)
/// Get the saved creative history
/// - Parameter completion: Completion block with the creative history
func getCreativeHistory(completion: @escaping ([AATPlacementHistoryInfo]) -> Void)
}
@protocol AATBannerCacheStatusDelegate;
/// A cache of automatically preloaded banner ads.
/// The cache will always try to have a defined amount of banners available for immediate handout to the app whenever they are needed. <em>Note:</em> The BannerCache needs to be destroyed when no longer needed.
SWIFT_PROTOCOL("_TtP6AATKit14AATBannerCache_")
@protocol AATBannerCache
/// Sets the placement statistics delegate
@property (nonatomic, strong) id <AATStatisticsDelegate> _Nullable statisticsDelegate;
/// Sets the placement impression delegate
@property (nonatomic, strong) id <AATImpressionDelegate> _Nullable impressionDelegate;
/// The delegate that represents the cache status
@property (nonatomic, strong) id <AATBannerCacheStatusDelegate> _Nullable cacheStatusDelegate;
@property (nonatomic, strong) AATCollapsibleBannerOptions * _Nullable collapsableBannerOptions;
/// Updates the configuration that will be used when requesting new banners.
/// \param requestConfiguration AATBannerRequest instance
///
/// \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.
///
- (void)updateRequestConfiguration:(AATBannerRequest * _Nonnull)requestConfiguration shouldRefresh:(BOOL)shouldRefresh;
/// Returns an instance of <code>AATBannerPlacementWrapperView</code> 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 <code>AATBannerCacheConfiguration/minDelay</code>.
///
///
/// returns:
/// Ad View to be displayed.
- (AATBannerPlacementWrapperView * _Nullable)consumeWithForce:(BOOL)force SWIFT_WARN_UNUSED_RESULT;
/// Returns an instance of <code>AATBannerPlacementWrapperView</code> to be used within the app. Also automatically counts an ad space. It will respect the frequency capping set by <code>AATBannerCacheConfiguration/minDelay</code>.
/// BannerCache will no longer hold any references to returned banners, and they need to be destroyed manually by the app.
///
/// returns:
/// Ad View to be displayed.
- (AATBannerPlacementWrapperView * _Nullable)consume SWIFT_WARN_UNUSED_RESULT;
/// Destroys the BannerCache, clearing all preloaded banner ads and canceling pending reload requests.
/// <ul>
/// <li>
/// For proper memory management, it needs to be called when the BannerCache is no longer needed.
/// </li>
/// <li>
/// Destroyed BannerCache can no longer be used
/// </li>
/// </ul>
- (void)destroy;
/// Enable saving creative history
/// \param size The max size of the history to be saved
///
- (void)enableCreativeHistoryWithSize:(NSInteger)size;
/// Get the saved creative history
/// \param completion Completion block with the creative history
///
- (void)getCreativeHistoryWithCompletion:(void (^ _Nonnull)(NSArray<AATPlacementHistoryInfo *> * _Nonnull))completion;
@end
Last updated