NimbusAdManager
final class NimbusAdManager
extension NimbusAdManager : AdControllerDelegate, AdManager, AdVisibilityDelegate, Copyable, NimbusAdViewControllerDelegate, NimbusRequestManagerDelegate, RequestManager
Manages the entire lifecycle of the ad from requesting to rendering
-
Unique session id for the current app session
Declaration
Swift
static var sessionId: String { get set }
-
Details about the publisher’s app (i.e., non-browser applications). Only applicable and recommended for apps.
Declaration
Swift
static var app: NimbusApp? { get set }
-
Details about the human user of the device; the advertising audience
Declaration
Swift
static var user: NimbusUser? { get set }
-
Black list of buyer seats (e.g., advertisers, agencies) restricted from bidding on this impression
Declaration
Swift
static var blocklistBuyers: Set<String>? { get set }
-
Block list of advertisers by their domains (e.g., “ford.com”)
Declaration
Swift
static var blockedAdvertisingDomains: Set<URL>? { get set }
-
Block list of applications by their platform-specific exchange-independent application identifiers (numeric IDs)
Declaration
Swift
static var blockedApps: Set<String>? { get set }
-
Nimbus request interceptors used for demand like APS, FAN and LiveRamp
Declaration
Swift
static var requestInterceptors: [any NimbusRequestInterceptor]? { get set }
-
Provides data about the inventory source and which entity makes the final decision
Declaration
Swift
static var source: NimbusSource? { get set }
-
Request URL for bid requests
Declaration
Swift
static var requestUrl: URL? { get set }
-
Additional request headers
Declaration
Swift
static var additionalRequestHeaders: [String : String]? { get set }
-
The timeout sent with the request for Nimbus auction in milliseconds
Declaration
Swift
static var auctionTimeout: Int? { get set }
-
Declaration
Swift
static var extendedIds: Set<NimbusExtendedId>? { get set }
-
Initial volume of the ad (0-100). Defaults to 0
Declaration
Swift
var volume: Int
-
Delegate for the ad manager
Declaration
Swift
weak var delegate: (any NimbusAdManagerDelegate)?
-
Initializes a
NimbusAdManager
object- publisher: Defaults to the
publisher
used to initialize the SDK. Can be overridden withapiKey
to have this NimbusAdManager instance send requests to a different Nimbus environment. - apiKey: Defaults to the
apiKey
used to initialize the SDK. Can be overridden withpublisherKey
to have this NimbusAdManager instance send requests to a different Nimbus environment.
Declaration
Swift
init(publisher: String? = nil, apiKey: String? = nil)
Parameters
publisher
Defaults to the
publisher
used to initialize the SDK. Can be overridden withapiKey
to have this NimbusAdManager instance send requests to a different Nimbus environment.apiKey
Defaults to the
apiKey
used to initialize the SDK. Can be overridden withpublisherKey
to have this NimbusAdManager instance send requests to a different Nimbus environment. - publisher: Defaults to the
-
Show an ad
- request: NimbusRequest for this impression
- container: Container view for the ad
- adPresentingViewController: The view controller containing the Nimbus ad
Declaration
Swift
func showAd(request: NimbusRequest, container: UIView, adPresentingViewController: UIViewController)
Parameters
request
NimbusRequest for this impression
container
Container view for the ad
adPresentingViewController
The view controller containing the Nimbus ad
-
Show a refreshing ad
- request: NimbusRequest for this impression
- container: Container view for the ad
- refreshInterval: Refresh interval for the ad in seconds (minimum 30 seconds)
- adPresentingViewController: The view controller containing the Nimbus ad
Declaration
Swift
func showAd(request: NimbusRequest, container: UIView, refreshInterval: TimeInterval, adPresentingViewController: UIViewController)
Parameters
request
NimbusRequest for this impression
container
Container view for the ad
refreshInterval
Refresh interval for the ad in seconds (minimum 30 seconds)
adPresentingViewController
The view controller containing the Nimbus ad
-
Show a blocking ad
- request: NimbusRequest for this impression
- closeButtonDelay: Delay before showing the close button in seconds (Default: 5 seconds)
- adPresentingViewController: The view controller that will present the Nimbus ad
Declaration
Swift
func showBlockingAd(request: NimbusRequest, closeButtonDelay: TimeInterval = Nimbus.blockingAdDefaultCloseButtonDelay, adPresentingViewController: UIViewController)
Parameters
request
NimbusRequest for this impression
closeButtonDelay
Delay before showing the close button in seconds (Default: 5 seconds)
adPresentingViewController
The view controller that will present the Nimbus ad
-
Show a rewarded video ad
- request: NimbusRequest for this impression.
- closeButtonDelay: Delay before showing the close button in seconds (Default: 5 seconds)
- adPresentingViewController: The view controller that will present the Nimbus ad
Declaration
Swift
@available(*, deprecated, renamed: "showRewardedAd") func showRewardedVideoAd(request: NimbusRequest, closeButtonDelay: TimeInterval = Nimbus.blockingAdDefaultCloseButtonDelay, adPresentingViewController: UIViewController)
Parameters
request
NimbusRequest for this impression.
closeButtonDelay
Delay before showing the close button in seconds (Default: 5 seconds)
adPresentingViewController
The view controller that will present the Nimbus ad
-
Show a rewarded video ad
- request: NimbusRequest for this impression.
- closeButtonDelay: Delay before showing the close button in seconds (Default: 5 seconds). Close button for a video ad only shows up after the video ad completes
- adPresentingViewController: The view controller that will present the Nimbus ad
Declaration
Swift
func showRewardedAd(request: NimbusRequest, closeButtonDelay: TimeInterval = Nimbus.blockingAdDefaultCloseButtonDelay, adPresentingViewController: UIViewController)
Parameters
request
NimbusRequest for this impression.
closeButtonDelay
Delay before showing the close button in seconds (Default: 5 seconds). Close button for a video ad only shows up after the video ad completes
adPresentingViewController
The view controller that will present the Nimbus ad
-
Notifies Nimbus of an external auction win
- ad: Nimbus ad corresponding to this auction
- auctionData: Auction data for this auction
Declaration
Swift
func notifyWin(ad: NimbusAd, auctionData: NimbusAuctionData?)
Parameters
ad
Nimbus ad corresponding to this auction
auctionData
Auction data for this auction
-
Notifies Nimbus of an external auction loss
- ad: The Nimbus ad corresponding to this auction
- auctionData: Auction data for this auction
Declaration
Swift
func notifyLoss(ad: NimbusAd, auctionData: NimbusAuctionData?)
Parameters
ad
The Nimbus ad corresponding to this auction
auctionData
Auction data for this auction
-
Declaration
Swift
func viewWillAppear(animated: Bool)
-
Declaration
Swift
func viewDidAppear(animated: Bool)
-
Declaration
Swift
func viewWillDisappear(animated: Bool)
-
Declaration
Swift
func viewDidDisappear(animated: Bool)
-
Declaration
Swift
func didCloseAd(adView: NimbusAdView)
-
Received an event for the ad
Declaration
Swift
func didReceiveNimbusEvent(controller: any AdController, event: NimbusEvent)
-
Received an error for the ad
Declaration
Swift
func didReceiveNimbusError(controller: any AdController, error: any NimbusError)