AdUnit
@objcMembers
public class AdUnit : NSObject, DispatcherDelegate
Base class for ad units built for original type of integration.
-
ORTB: imp[].ext.data.pbadslot
Declaration
Swift
public var pbAdSlot: String? { get set } -
The position of the ad on the screen.
Declaration
Swift
public var adPosition: AdPosition { get set } -
Initializes a new
AdUnitinstance with the specified configuration ID, size, and ad formats.Declaration
Swift
public init(configId: String, size: CGSize?, adFormats: Set<AdFormat>)Parameters
configIdThe configuration ID for the ad unit.
sizeThe primary size of the ad. If
nil, a default size of.zerois used.adFormatsA set of ad formats supported by the ad unit.
-
Makes bid request for a specific ad object and provides the result code. Setups targeting keywords into the adObject.
Declaration
Swift
dynamic public func fetchDemand( adObject: AnyObject, completion: @escaping(_ result: ResultCode) -> Void )Parameters
adObjectThe ad object for which demand is being fetched.
completionA closure called with the result code indicating the outcome of the demand fetch.
-
Sets the GPID for the ad unit.
Declaration
Swift
public func setGPID(_ gpid: String?)Parameters
gpidThe GPID string to set. Can be
nilto clear the GPID. -
Retrieves the current GPID for the ad unit.
Declaration
Swift
public func getGPID() -> String?Return Value
The GPID string, or
nilif no GPID is set.
-
Sets the impression-level OpenRTB configuration string for the ad unit.
Declaration
Swift
public func setImpORTBConfig(_ ortbConfig: String?)Parameters
ortbConfigThe impression-level OpenRTB configuration string to set. Can be
nilto clear the configuration. -
Returns the impression-level OpenRTB configuration string.
Declaration
Swift
public func getImpORTBConfig() -> String? -
Sets the global OpenRTB configuration string for the ad unit. It takes precedence over
Targeting.setGlobalOrtbConfig.Declaration
Swift
public func setGlobalOrtbConfig(_ ortbConfig: String?)Parameters
ortbConfigThe global OpenRTB configuration string to set. Can be
nilto clear the configuration. -
Returns the global OpenRTB configuration string.
Declaration
Swift
public func getGlobalOrtbConfig() -> String?
-
This method allows to set the auto refresh period for the demand
Declaration
Swift
public func setAutoRefreshMillis(time: Double)Parameters
timerefresh time interval
-
This method stops the auto refresh of demand
Declaration
Swift
public func stopAutoRefresh() -
This method resumes the auto refresh of demand
Declaration
Swift
public func resumeAutoRefresh()