MediationBannerAdUnit

@objcMembers
public class MediationBannerAdUnit : NSObject

This class is responsible for making bid request and providing the winning bid and targeting keywords to mediating SDKs. This class is a part of Mediation API.

Computed properties

  • The configuration ID for an ad unit

    Declaration

    Swift

    public var configID: String { get }
  • The ad format for the ad unit.

    Declaration

    Swift

    public var adFormat: AdFormat { get set }
  • The position of the ad on the screen.

    Declaration

    Swift

    public var adPosition: AdPosition { get set }
  • Parameters for configuring banner ads.

    Declaration

    Swift

    public var bannerParameters: BannerParameters { get }
  • Parameters for configuring video ads.

    Declaration

    Swift

    public var videoParameters: VideoParameters { get }
  • The refresh interval for the ad.

    Declaration

    Swift

    public var refreshInterval: TimeInterval { get set }
  • Additional sizes for the ad unit.

    Declaration

    Swift

    public var additionalSizes: [CGSize]? { get set }

Arbitrary ORTB Configuration

  • Sets the impression-level OpenRTB configuration string for the ad unit.

    Declaration

    Swift

    public func setImpORTBConfig(_ ortbConfig: String?)

    Parameters

    ortbObject

    The impression-level OpenRTB configuration string to set. Can be nil to clear the configuration.

  • Returns the impression-level OpenRTB configuration string.

    Declaration

    Swift

    public func getImpORTBConfig() -> String?

Public Methods

  • Initializes a new mediation banner ad unit with the specified configuration ID, size, and mediation delegate.

    Declaration

    Swift

    public init(configID: String, size: CGSize, mediationDelegate: PrebidMediationDelegate)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

    size

    The size of the ad.

    mediationDelegate

    The delegate for handling mediation.

  • Makes bid request and setups mediation parameters.

    Declaration

    Swift

    public func fetchDemand(completion: ((ResultCode) -> Void)?)

    Parameters

    completion

    The completion handler to call when the demand fetch is complete.

  • Stops the auto-refresh for the ad unit.

    Declaration

    Swift

    public func stopRefresh()
  • Handles the event when the ad object fails to load an ad.

    Declaration

    Swift

    public func adObjectDidFailToLoadAd(adObject: UIView,
                                        with error: Error)

    Parameters

    adObject

    The ad object that failed to load the ad.

    error

    The error that occurred during the ad load.