AppOpenAds
public class AppOpenAds
This class is the entry point for displaying app open ads.
To start, load an app open ad by providing a valid placement id in the
load(placementId:)
method.
Note: Only one call to app open load per placement id is needed. Subsequent calls with the same placement id will be ignored.
-
Adds a delegate for handling all app open ads events.
The delegate must adopt the
AppOpenAdsDelegate
protocol. The delegate is not retained.Declaration
Swift
public func addDelegate(_ delegate: AppOpenAdsDelegate)
Parameters
delegate
the delegate that will listen to all app open ad events.
-
Removes a delegate that was previously handling app open ads events.
Declaration
Swift
public func removeDelegate(_ delegate: AppOpenAdsDelegate)
Parameters
delegate
the delegate to be removed.
-
Starts loading a new app open ad.
After the first call, no more calls to this method are needed, as the ad will reload automatically.
Declaration
Swift
public func load(placementId: String)
Parameters
placementId
The placement id of the ad to be loaded.
-
Indicates if there is an app open ad ready to be presented for any placement id.
Declaration
Swift
public func isReady() -> Bool
Return Value
true if an ad is ready to be presented.
-
Indicates if an app open ad for the placement id is ready to be presented.
Declaration
Swift
public func isReady(withPlacementId placementId: String) -> Bool
Parameters
placementId
The placement id of the ad.
Return Value
true if an ad is ready to be presented.
-
Presents a previously loaded app open ad for any placement id.
If multiple ads with different placement ids were previously loaded, the sdk will try to present the best one available.
Declaration
Swift
public func present(fromViewController viewController: UIViewController)
Parameters
viewController
A view controller to present the ad.
-
Presents a previously loaded app open ad for any placement id.
If multiple ads with different placement ids were previously loaded, the sdk will try to present the best one available.
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.
-
Presents a previously loaded app open for the placement id.
Declaration
Swift
public func present(withPlacementId placementId: String, fromViewController viewController: UIViewController)
Parameters
placementId
The placement id of the ad.
viewController
A view controller to present the ad.
-
Presents a previously loaded app open for the placement id.
Declaration
Swift
public func present(withPlacementId placementId: String, fromViewController viewController: UIViewController, fromAdSpace adSpace: String)
Parameters
placementId
The placement id of the ad.
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.