RewardedAdUnit

@objc
@objcMembers
public class RewardedAdUnit : NSObject, BaseInterstitialAdUnitProtocol

Represents an rewarded ad unit. Built for rendering type of integration.

  • A delegate for handling interactions with the ad unit.

    Declaration

    Swift

    public weak var delegate: RewardedAdUnitDelegate?
  • A Boolean value indicating whether the ad unit is ready to be displayed.

    Declaration

    Swift

    public var isReady: Bool { get }
  • The set of ad formats supported by this ad unit.

    Only .banner and .video can be rendered by RewardedAdUnit. Empty sets and sets containing unsupported formats are ignored.

    Declaration

    Swift

    public var adFormats: Set<AdFormat> { get set }
  • The position of the ad on the screen.

    Declaration

    Swift

    public var adPosition: AdPosition { get set }
  • The banner parameters used for configuring ad unit.

    Declaration

    Swift

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

    Declaration

    Swift

    public var videoParameters: VideoParameters { get }

SKAdNetwork

  • A flag that determines whether SKOverlay should be supported

    Declaration

    Swift

    public var supportSKOverlay: Bool { get set }

Video controls configuration

  • The area of the close button in the video controls as a percentage.

    Declaration

    Swift

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

    Declaration

    Swift

    public var closeButtonPosition: Position { get set }
  • A Boolean value indicating whether the video controls are muted.

    Declaration

    Swift

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

    Declaration

    Swift

    public var isSoundButtonVisible: Bool { get set }

Private properties

  • 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.

  • Initializes a new InterstitialRenderingAdUnit 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 InterstitialRenderingAdUnit 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 object for handling ad events.

  • Initializes a new InterstitialRenderingAdUnit 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 object for handling ad events.

Public methods

  • Loads a new ad.

    Declaration

    Swift

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

    Note

    This method must be called on the main thread.

    Declaration

    Swift

    public func show(from controller: UIViewController)

    Parameters

    controller

    The view controller from which the ad will be presented.

Arbitrary ORTB Configuration

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

    Declaration

    Swift

    public func setImpORTBConfig(_ ortbConfig: String?)

    Parameters

    ortbConfig

    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?
  • Sets the global OpenRTB configuration string for the ad unit. It takes precedence over Targeting.setGlobalOrtbConfig.

    Declaration

    Swift

    public func setGlobalORTBConfig(_ ortbConfig: String?)

    Parameters

    ortbConfig

    The global OpenRTB configuration string to set. Can be nil to clear the configuration.

  • Returns the global OpenRTB configuration string.

    Declaration

    Swift

    public func getGlobalORTBConfig() -> String?