Setting up a Banner Ad Placement - View based
The SDK supports Banner Ads using theCIBannerView view and the setPlacement API.
Below is an example of how to set up a fixed CIBannerView in an XML layout:
setPlacement API has the following parameters:
Required
placementID: String: Unique ID for this Ad Placement provided by Content Ignite.pageUrl: String?: This is used for targeting for example if the ad is displayed inline within an article or section of the app which has an equivalent URL on the web.
Optional
eventListener: CIBannerEventListener: Interface which enables you to respond to events related to the banner ad.targeting: Map<String, List<String>>: Pass custom key-value pairs to ad requests.publisher: (() -> View)?: This function parameter is used to return a fallback view, It allows you to fall back to your existing Ad implementation for this particular placement. This gives publishers full control over the use of the SDK and the rate at which this fallback is used can be controlled directly through the Fusion platform.
Handling ad events
To listen and respond to events from an Interstitial ad, use theCIBannerEventListener protocol: