NativeRequest
public class NativeRequest : AdUnit
A class representing a native request for original type of integration.
-
The version of the native ad specification being used. Defaults to “1.2” if not set.
Declaration
Swift
public var version: String { get set } -
The context in which the ad appears. See
ContextTypefor possible values.Declaration
Swift
public var context: ContextType? { get set } -
A more detailed context in which the ad appears. See
ContextSubTypefor possible values.Declaration
Swift
public var contextSubType: ContextSubType? { get set } -
The design/format/layout of the ad unit being offered. See
PlacementTypefor possible values.Declaration
Swift
public var placementType: PlacementType? { get set } -
The number of identical placements in the ad layout. Defaults to 1 if not set.
Declaration
Swift
public var placementCount: Int { get set } -
The sequence number of the ad. Defaults to 0 if not set.
Declaration
Swift
public var sequence: Int { get set } -
An array of
NativeAssetobjects representing the assets required for the native ad request.Declaration
Swift
public var assets: [NativeAsset]? { get set } -
Indicates whether the supply source/impression supports returning an
assetsurlinstead of an asset object. Defaults to 0 if not set.Declaration
Swift
public var asseturlsupport: Int { get set } -
Indicates whether the supply source/impression supports returning a
dcoURL instead of an asset object. Defaults to 0 if not set.Declaration
Swift
public var durlsupport: Int { get set } -
An array of
NativeEventTrackerobjects specifying the event tracking settings for the native ad.Declaration
Swift
public var eventtrackers: [NativeEventTracker]? { get set } -
Indicates whether the native ad supports a buyer-specific privacy notice. Defaults to 0 if not set.
Declaration
Swift
public var privacy: Int { get set } -
A placeholder for custom JSON agreed to by the parties to support flexibility beyond the standard specification.
Declaration
Swift
public var ext: [String : Any]? { get set } -
The configuration ID for the ad unit.
Declaration
Swift
public var configId: String { get set } -
Initializes a
NativeRequestwith a specified configuration ID.Declaration
Swift
public init(configId: String)Parameters
configIdThe configuration ID for the ad unit.
-
Initializes a
NativeRequestwith a specified configuration ID, assets, and event trackers.Declaration
Swift
public convenience init(configId: String, assets: [NativeAsset]? = nil, eventTrackers: [NativeEventTracker]? = nil)Parameters
configIdThe configuration ID for the ad unit.
assetsAn optional array of
NativeAssetobjects.eventTrackersAn optional array of
NativeEventTrackerobjects. -
Adds an array of native assets to the request. If assets already exist, they will be appended.
Declaration
Swift
public func addNativeAssets(_ assets: [NativeAsset])Parameters
assetsAn array of
NativeAssetobjects to add. -
Adds an array of native event trackers to the request. If event trackers already exist, they will be appended.
Declaration
Swift
public func addNativeEventTracker(_ eventTrackers: [NativeEventTracker])Parameters
eventTrackersAn array of
NativeEventTrackerobjects to add. -
Retrieves the native request object as a JSON dictionary.
Declaration
Swift
public func getNativeRequestObject() -> [AnyHashable : Any]?Return Value
A dictionary representation of the native request object, or
nilif an error occurs.