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
MediationNativeAdUnitwith the specified configuration ID and mediation delegate.Declaration
Swift
public init(configId: String, mediationDelegate: PrebidMediationDelegate)Parameters
configIdThe configuration ID for the ad unit.
mediationDelegateThe delegate for mediation-related tasks.
-
Adds event trackers to the native ad unit.
Declaration
Swift
public func addEventTracker(_ eventTrackers: [NativeEventTracker])Parameters
eventTrackersAn array of
NativeEventTrackerobjects to add. -
Adds native assets to the native ad unit.
Declaration
Swift
public func addNativeAssets(_ assets: [NativeAsset])Parameters
assetsAn array of
NativeAssetobjects to add. -
Sets the context type for the native ad unit.
Declaration
Swift
public func setContextType(_ contextType: ContextType)Parameters
contextTypeThe context type to set.
-
Sets the placement type for the native ad unit.
Declaration
Swift
public func setPlacementType(_ placementType: PlacementType)Parameters
placementTypeThe placement type to set.
-
Sets the placement count for the native ad unit.
Declaration
Swift
public func setPlacementCount(_ placementCount: Int)Parameters
placementCountThe placement count to set.
-
Sets the context subtype for the native ad unit.
Declaration
Swift
public func setContextSubType(_ contextSubType: ContextSubType)Parameters
contextSubTypeThe context subtype to set.
-
Sets the sequence for the native ad unit.
Declaration
Swift
public func setSequence(_ sequence: Int)Parameters
sequenceThe sequence to set.
-
Sets the asset URL support for the native ad unit.
Declaration
Swift
public func setAssetURLSupport(_ assetURLSupport: Int)Parameters
assetURLSupportThe asset URL support value to set.
-
Sets the DURL support for the native ad unit.
Declaration
Swift
public func setDURLSupport(_ dURLSupport: Int)Parameters
dURLSupportThe DURL support value to set.
-
Sets the privacy value for the native ad unit.
Declaration
Swift
public func setPrivacy(_ privacy: Int)Parameters
privacyThe privacy value to set.
-
Sets the extended data for the native ad unit.
Declaration
Swift
public func setExt(_ ext: [String : Any])Parameters
extA 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
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? -
Makes bid request for the native ad unit and setups mediation parameters.
Declaration
Swift
public func fetchDemand(completion: ((ResultCode) -> Void)?)Parameters
completionThe completion handler to call with the result code.