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
RewardedDelegateprotocol. 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
customPropertiesAn optional
CustomPropertiesobject containing custom properties, useful for tracking. -
Presents a previously loaded rewarded ad.
Declaration
Swift
public func present(fromViewController viewController: UIViewController)Parameters
viewControllerA view controller to present the ad.
-
Presents a previously loaded rewarded ad.
Declaration
Swift
public func present(fromViewController viewController: UIViewController, fromAdSpace adSpace: String)Parameters
viewControllerA view controller to present the ad.
adSpaceThe 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) -> RewardedParameters
placementIdA string containing a valid placement id.
testWhether a test rewarded ad should be loaded. This is only for testing purposes, should be false on production builds.
verboseEnable logging for this rewarded ad instance. This is only for debugging purposes, should be false on production builds.
Return Value
A
Rewardedinstance ready to load.