MediationNativeAdUnit
@objcMembers
public class MediationNativeAdUnit : NSObject
This class is responsible for making bid request and providing the winning bid and targeting keywords to mediating SDKs. This class is a part of Mediation API.
-
The native ad unit that makes native request.
Declaration
Swift
public var nativeAdUnit: NativeRequest
-
Initializes a new instance of the
MediationNativeAdUnit
with the specified configuration ID and mediation delegate.Declaration
Swift
public init(configId: String, mediationDelegate: PrebidMediationDelegate)
Parameters
configId
The configuration ID for the ad unit.
mediationDelegate
The delegate for mediation-related tasks.
-
Adds event trackers to the native ad unit.
Declaration
Swift
public func addEventTracker(_ eventTrackers: [NativeEventTracker])
Parameters
eventTrackers
An array of
NativeEventTracker
objects to add. -
Adds native assets to the native ad unit.
Declaration
Swift
public func addNativeAssets(_ assets: [NativeAsset])
Parameters
assets
An array of
NativeAsset
objects to add. -
Sets the context type for the native ad unit.
Declaration
Swift
public func setContextType(_ contextType: ContextType)
Parameters
contextType
The context type to set.
-
Sets the placement type for the native ad unit.
Declaration
Swift
public func setPlacementType(_ placementType: PlacementType)
Parameters
placementType
The placement type to set.
-
Sets the placement count for the native ad unit.
Declaration
Swift
public func setPlacementCount(_ placementCount: Int)
Parameters
placementCount
The placement count to set.
-
Sets the context subtype for the native ad unit.
Declaration
Swift
public func setContextSubType(_ contextSubType: ContextSubType)
Parameters
contextSubType
The context subtype to set.
-
Sets the sequence for the native ad unit.
Declaration
Swift
public func setSequence(_ sequence: Int)
Parameters
sequence
The sequence to set.
-
Sets the asset URL support for the native ad unit.
Declaration
Swift
public func setAssetURLSupport(_ assetURLSupport: Int)
Parameters
assetURLSupport
The asset URL support value to set.
-
Sets the DURL support for the native ad unit.
Declaration
Swift
public func setDURLSupport(_ dURLSupport: Int)
Parameters
dURLSupport
The DURL support value to set.
-
Sets the privacy value for the native ad unit.
Declaration
Swift
public func setPrivacy(_ privacy: Int)
Parameters
privacy
The privacy value to set.
-
Sets the extended data for the native ad unit.
Declaration
Swift
public func setExt(_ ext: [String : Any])
Parameters
ext
A dictionary containing the extended data to set.
-
Sets the impression-level OpenRTB configuration string for the ad unit.
Declaration
Swift
public func setImpORTBConfig(_ ortbConfig: String?)
Parameters
ortbObject
The impression-level OpenRTB configuration string to set. Can be
nil
to clear the configuration. -
Returns the impression-level OpenRTB configuration string.
Declaration
Swift
public func getImpORTBConfig() -> String?
-
Makes bid request for the native ad unit and setups mediation parameters.
Declaration
Swift
public func fetchDemand(completion: ((ResultCode) -> Void)?)
Parameters
completion
The completion handler to call with the result code.