Rewarded

public class Rewarded

This class represents a Rewarded Ad format.

You call the static method create(placementId:test:verbose:) to create a new rewarded ad instance.

  • The placement Id for this rewarded ad.

    Declaration

    Swift

    public let placementId: String
  • The object that acts as the delegate of the rewarded ad.

    The delegate must adopt the RewardedDelegate protocol. The delegate is not retained.

    Declaration

    Swift

    public weak var delegate: RewardedDelegate?
  • Indicates if the rewarded ad is ready to be presented.

    Declaration

    Swift

    public var isReady: Bool { get }
  • Starts a new load call.

    Declaration

    Swift

    public func load(customProperties: CustomProperties = CustomProperties())

    Parameters

    customProperties

    An optional CustomProperties object containing custom properties, useful for tracking.

  • Presents a previously loaded rewarded ad.

    Declaration

    Swift

    public func present(fromViewController viewController: UIViewController)

    Parameters

    viewController

    A view controller to present the ad.

  • Presents a previously loaded rewarded ad.

    Declaration

    Swift

    public func present(fromViewController viewController: UIViewController, fromAdSpace adSpace: String)

    Parameters

    viewController

    A view controller to present the ad.

    adSpace

    The space in your app from where the ad will be shown (eg: dashboard, settings). Used for tracking.

  • Creates a new instance of a Rewarded.

    Declaration

    Swift

    public static func create(placementId: String, test: Bool = false, verbose: Bool = false) -> Rewarded

    Parameters

    placementId

    A string containing a valid placement id.

    test

    Whether a test rewarded ad should be loaded. This is only for testing purposes, should be false on production builds.

    verbose

    Enable logging for this rewarded ad instance. This is only for debugging purposes, should be false on production builds.

    Return Value

    A Rewarded instance ready to load.