Skip to content

Setup

Standard Implementation

To display a banner ad, follow these steps

  • Create a RingierAdBannerView object.
  • Set its controller property, which should be the UIViewController responsible for presenting the ad.
  • Set its delegate property to receive ad lifecycle callbacks (see next section).
  • Add the banner view to your application's view hierarchy.
  • Create a RingierAdBannerViewParams object, configuring it with the necessary category and placement name.
  • Call the loadAd(params:) method on your banner view instance, passing the newly created params object.

Example

Here is a typical initialization for the RingierAdBannerViewParams object.

swift
let params = RingierAdBannerViewParams(
    category: "your-ad-category",
    placementOrAlias: "your-slot-code",
    ignoreLazyLoading: true
)
// Now, call loadAd
myBannerView.loadAd(params: params)

TIP

To significantly improve viewability numbers for inline banner placements, implement a preloading logic that initiates the ad loading process before the first pixel of the ad is visible in the user's viewport.

Instead of waiting for the banner to be fully in the viewport or for its first pixel to appear, trigger the load when the ad container is within a defined buffer zone (e.g., 500 to 1000 pixels) outside the visible area. This ensures that the ad creative is fully loaded and ready to render by the time the user scrolls it into view, which maximizes the duration it can be counted as "viewable."