BaseInterstitialAdUnit

public class BaseInterstitialAdUnit :
    NSObject,
    PBMInterstitialAdLoaderDelegate,
    AdLoadFlowControllerDelegate,
    InterstitialControllerInteractionDelegate,
    InterstitialEventInteractionDelegate,
    BaseInterstitialAdUnitProtocol

A base class for interstitial ad units.

Public Properties

  • The banner parameters used for configuring ad unit.

    Declaration

    Swift

    @objc
    public var bannerParameters: BannerParameters { get }
  • The video parameters used for configuring ad unit.

    Declaration

    Swift

    @objc
    public var videoParameters: VideoParameters { get }
  • The last bid response received for the ad unit.

    Declaration

    Swift

    @objc
    public var lastBidResponse: BidResponse? { get }
  • The configuration ID for the ad unit.

    Declaration

    Swift

    @objc
    public var configID: String { get }
  • The set of ad formats supported by this ad unit.

    Declaration

    Swift

    @objc
    public var adFormats: Set<AdFormat> { get set }
  • The ORTB (OpenRTB) configuration string for the ad unit.

    Declaration

    Swift

    @objc
    public var ortbConfig: String? { get set }
  • A Boolean value indicating whether the ad unit is ready to be displayed.

    Declaration

    Swift

    @objc
    public var isReady: Bool { get }
  • A Boolean value indicating whether the video controls are muted.

    Declaration

    Swift

    @objc
    public var isMuted: Bool { get set }
  • A Boolean value indicating whether the sound button is visible in the video controls.

    Declaration

    Swift

    @objc
    public var isSoundButtonVisible: Bool { get set }
  • The area of the close button in the video controls as a percentage.

    Declaration

    Swift

    @objc
    public var closeButtonArea: Double { get set }
  • The position of the close button in the video controls.

    Declaration

    Swift

    @objc
    public var closeButtonPosition: Position { get set }
  • A delegate for handling interactions with the ad unit.

    Declaration

    Swift

    @objc
    public weak var delegate: AnyObject?
  • The configuration object for the ad unit.

    Declaration

    Swift

    public let adUnitConfig: AdUnitConfig

Public Methods

  • Initializes a new BaseInterstitialAdUnit with the specified configuration ID, minimum size percentage, and event handler.

    Declaration

    Swift

    required public init(configID: String,
                         minSizePerc: NSValue?,
                         eventHandler: AnyObject?)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

    minSizePerc

    The minimum size percentage for the ad unit.

    eventHandler

    An optional event handler object for handling ad events.

  • Initializes a new BaseInterstitialAdUnit with the specified configuration ID, minimum size percentage, and event handler.

    Declaration

    Swift

    public convenience init(configID: String,
                            minSizePercentage: CGSize,
                            eventHandler:AnyObject?)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

    minSizePercentage

    The minimum size percentage for the ad unit.

    eventHandler

    An optional event handler object for handling ad events.

  • Initializes a new BaseInterstitialAdUnit with the specified configuration ID and event handler.

    Declaration

    Swift

    public convenience init(configID: String,
                            eventHandler:AnyObject?)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

    eventHandler

    An optional event handler object for handling ad events.

  • Initializes a new BaseInterstitialAdUnit with the specified configuration ID and minimum size percentage.

    Declaration

    Swift

    public convenience init(configID: String,
                            minSizePercentage:CGSize)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

    minSizePercentage

    The minimum size percentage for the ad unit.

  • Initializes a new BaseInterstitialAdUnit with the specified configuration ID.

    Declaration

    Swift

    public convenience init(configID: String)

    Parameters

    configID

    The unique identifier for the ad unit configuration.

  • Loads a new ad.

    Declaration

    Swift

    @objc
    public func loadAd()
  • Shows the ad from a specified view controller.

    Note

    This method must be called on the main thread.

    Declaration

    Swift

    @objc
    public func show(from controller: UIViewController)

    Parameters

    controller

    The view controller from which the ad will be presented.

Ext Data (imp[].ext.data)

  • Adds context data for a specified key.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use addExtData method instead.")
    @objc
    public func addContextData(_ data: String, forKey key: String)

    Parameters

    data

    The data to add.

    key

    The key associated with the data.

  • Updates context data for a specified key.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use updateExtData method instead.")
    @objc
    public func updateContextData(_ data: Set<String>, forKey key: String)

    Parameters

    data

    A set of data to update.

    key

    The key associated with the data.

  • Removes context data for a specified key.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use removeExtData method instead.")
    @objc
    public func removeContextDate(forKey key: String)

    Parameters

    key

    The key associated with the data to remove.

  • Clears all context data.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use clearExtData method instead.")
    @objc
    public func clearContextData()
  • Adds ext data.

    Declaration

    Swift

    @objc
    public func addExtData(key: String, value: String)

    Parameters

    key

    The key for the data.

    value

    The value for the data.

  • Updates ext data.

    Declaration

    Swift

    @objc
    public func updateExtData(key: String, value: Set<String>)

    Parameters

    key

    The key for the data.

    value

    The value for the data.

  • Removes ext data.

    Declaration

    Swift

    @objc
    public func removeExtData(forKey: String)

    Parameters

    key

    The key for the data.

  • Clears ext data.

    Declaration

    Swift

    @objc
    public func clearExtData()

Ext keywords (imp[].ext.keywords)

  • Adds a context keyword.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use addExtKeyword method instead.")
    @objc
    public func addContextKeyword(_ newElement: String)

    Parameters

    newElement

    The keyword to add.

  • Adds a set of context keywords.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use addExtKeywords method instead.")
    @objc
    public func addContextKeywords(_ newElements: Set<String>)

    Parameters

    newElements

    A set of keywords to add.

  • Removes a context keyword.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use removeExtKeyword method instead.")
    @objc
    public func removeContextKeyword(_ element: String)

    Parameters

    element

    The keyword to remove.

  • Clears all context keywords.

    Declaration

    Swift

    @available(*, deprecated, message: "This method is deprecated. Please, use clearExtKeywords method instead.")
    @objc
    public func clearContextKeywords()
  • Adds an extended keyword.

    Declaration

    Swift

    @objc
    public func addExtKeyword(_ newElement: String)

    Parameters

    newElement

    The keyword to be added.

  • Adds multiple extended keywords.

    Declaration

    Swift

    @objc
    public func addExtKeywords(_ newElements: Set<String>)

    Parameters

    newElements

    A set of keywords to be added.

  • Removes an extended keyword.

    Declaration

    Swift

    @objc
    public func removeExtKeyword(_ element: String)

    Parameters

    element

    The keyword to be removed.

  • Clears all extended keywords.

    Declaration

    Swift

    @objc
    public func clearExtKeywords()

App Content (app.content.data)

  • Sets the app content data.

    Declaration

    Swift

    @objc
    public func setAppContent(_ appContent: PBMORTBAppContent)

    Parameters

    appContent

    The app content data.

  • Clears the app content data.

    Declaration

    Swift

    @objc
    public func clearAppContent()
  • Adds app content data objects.

    Declaration

    Swift

    @objc
    public func addAppContentData(_ dataObjects: [PBMORTBContentData])

    Parameters

    dataObjects

    The data objects to be added.

  • Removes an app content data object.

    Declaration

    Swift

    @objc
    public func removeAppContentDataObject(_ dataObject: PBMORTBContentData)

    Parameters

    dataObject

    The data object to be removed.

  • Clears all app content data objects.

    Declaration

    Swift

    @objc
    public func clearAppContentDataObjects()

User Data (user.data)

  • Adds user data objects.

    Declaration

    Swift

    @objc
    public func addUserData(_ userDataObjects: [PBMORTBContentData])

    Parameters

    userDataObjects

    The user data objects to be added.

  • Removes a user data object.

    Declaration

    Swift

    @objc
    public func removeUserData(_ userDataObject: PBMORTBContentData)

    Parameters

    userDataObject

    The user data object to be removed.

  • Clears all user data objects.

    Declaration

    Swift

    @objc
    public func clearUserData()

PBMInterstitialAdLoaderDelegate

  • Internal delegate method.

    Declaration

    Swift

    public func interstitialAdLoader(_ interstitialAdLoader: PBMInterstitialAdLoader,
                                     loadedAd showBlock: @escaping (UIViewController?) -> Void,
                                     isReadyBlock: @escaping () -> Bool)
  • Internal delegate method.

    Declaration

    Swift

    public func interstitialAdLoader(_ interstitialAdLoader: PBMInterstitialAdLoader,
                                     createdInterstitialController interstitialController: InterstitialController)
  • The event handler for the interstitial events.

    Declaration

    Swift

    public var eventHandler: Any?

AdLoadFlowControllerDelegate

  • Called when the ad load flow controller is about to send a bid request.

    Declaration

    Swift

    public func adLoadFlowControllerWillSendBidRequest(_ adLoadFlowController: PBMAdLoadFlowController)
  • Called when the ad load flow controller is about to request the primary ad.

    Declaration

    Swift

    public func adLoadFlowControllerWillRequestPrimaryAd(_ adLoadFlowController: PBMAdLoadFlowController)
  • Called to determine if the ad load flow controller should continue with the current flow.

    Declaration

    Swift

    public func adLoadFlowControllerShouldContinue(_ adLoadFlowController: PBMAdLoadFlowController) -> Bool
  • Called when the ad load flow controller fails with an error.

    Declaration

    Swift

    public func adLoadFlowController(_ adLoadFlowController: PBMAdLoadFlowController, failedWithError error: Error?)

InterstitialControllerInteractionDelegate

  • Tracks an impression for the given interstitial controller.

    Declaration

    Swift

    public func trackImpression(forInterstitialController: InterstitialController)
  • Called when the ad in the interstitial controller is clicked.

    Declaration

    Swift

    public func interstitialControllerDidClickAd(_ interstitialController: InterstitialController)
  • Called when the ad in the interstitial controller is closed.

    Declaration

    Swift

    public func interstitialControllerDidCloseAd(_ interstitialController: InterstitialController)
  • Called when the ad in the interstitial controller causes the app to leave.

    Declaration

    Swift

    public func interstitialControllerDidLeaveApp(_ interstitialController: InterstitialController)
  • Called when the interstitial controller displays an ad.

    Declaration

    Swift

    public func interstitialControllerDidDisplay(_ interstitialController: InterstitialController)
  • Called when the interstitial controller completes the ad display.

    Declaration

    Swift

    public func interstitialControllerDidComplete(_ interstitialController: InterstitialController)
  • Provides the view controller to use for modal presentation.

    Declaration

    Swift

    public func viewControllerForModalPresentation(fromInterstitialController: InterstitialController) -> UIViewController?

InterstitialEventInteractionDelegate

  • Called when an ad is about to be presented.

    Declaration

    Swift

    public func willPresentAd()
  • Called when an ad has been dismissed.

    Declaration

    Swift

    public func didDismissAd()
  • Called when the ad causes the app to leave.

    Declaration

    Swift

    public func willLeaveApp()
  • Called when an ad is clicked.

    Declaration

    Swift

    public func didClickAd()

BaseInterstitialAdUnitProtocol

  • Requests an ad using the provided bid response.

    Declaration

    Swift

    public func callEventHandler_requestAd(with bidResponse: BidResponse?)
  • Displays the ad using the provided view controller.

    Declaration

    Swift

    public func callEventHandler_show(from controller: UIViewController?)

Abstract Methods