RewardedAdUnit

@objc
public class RewardedAdUnit: BaseInterstitialAdUnit,
                             RewardedEventInteractionDelegate

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

  • The reward object for the ad unit.

    Declaration

    Swift

    public private(set) var reward: NSObject? { get }

Lifecycle

  • Initializes a RewardedAdUnit with the given configuration ID and event handler.

    Declaration

    Swift

    @objc
    public convenience init(configID: String, eventHandler: AnyObject)

    Parameters

    configID

    The configuration ID for the ad unit.

    eventHandler

    The event handler for the ad unit.

  • Initializes a RewardedAdUnit with the given configuration ID and a default event handler.

    Declaration

    Swift

    @objc
    public convenience init(configID: String)

    Parameters

    configID

    The configuration ID for the ad unit.

PBMRewardedEventDelegate

  • Called when the user earns a reward.

    Declaration

    Swift

    public func userDidEarnReward(_ reward: NSObject?)

    Parameters

    reward

    The reward object associated with the event.

BaseInterstitialAdUnitProtocol protocol

  • Called when the interstitial ad is closed.

    Declaration

    Swift

    public override func interstitialControllerDidCloseAd(_ interstitialController: InterstitialController)

    Parameters

    interstitialController

    The controller managing the interstitial ad.

Protected overrides

  • Called when the ad unit receives an ad.

    Declaration

    Swift

    public override func callDelegate_didReceiveAd()
  • Called when the ad unit fails to receive an ad.

    Declaration

    Swift

    public override func callDelegate_didFailToReceiveAd(with error: Error?)

    Parameters

    error

    The error describing the failure.

  • Called when the ad unit will present an ad.

    Declaration

    Swift

    public override func callDelegate_willPresentAd()
  • Called when the ad unit dismisses an ad.

    Declaration

    Swift

    public override func callDelegate_didDismissAd()
  • Called when the ad unit will leave the application.

    Declaration

    Swift

    public override func callDelegate_willLeaveApplication()
  • Called when the ad unit is clicked.

    Declaration

    Swift

    public override func callDelegate_didClickAd()
  • Returns whether the event handler is ready.

    Declaration

    Swift

    public override func callEventHandler_isReady() -> Bool

    Return Value

    A boolean indicating if the event handler is ready.

  • Sets the loading delegate for the event handler.

    Declaration

    Swift

    public override func callEventHandler_setLoadingDelegate(_ loadingDelegate: NSObject?)

    Parameters

    loadingDelegate

    The loading delegate to set.

  • Sets the interaction delegate for the event handler.

    Declaration

    Swift

    public override func callEventHandler_setInteractionDelegate()
  • Requests an ad with the given bid response.

    Declaration

    Swift

    public override func callEventHandler_requestAd(with bidResponse: BidResponse?)

    Parameters

    bidResponse

    The bid response to use for the ad request.

  • Shows the ad from the specified view controller.

    Declaration

    Swift

    public override func callEventHandler_show(from controller: UIViewController?)

    Parameters

    controller

    The view controller from which to present the ad.

  • Tracks the impression for the ad.

    Declaration

    Swift

    public override func callEventHandler_trackImpression()