Native Ads

To integrate Native Ads, ensure you have integrated the DT Exchange IASDKCore Libraries. Configure the native ad spot, create an Ad Request, and then load the ad and map the assets to your native view components.

Importing the SDK

Import the following IASDKCore module into your desired view controller:

Objective-C
#import <IASDKCore/IASDKCore.h>

Creating the Ad Request Object

Initialize an IAAdRequest and provide the spotID and a timeout value:

Objective-C
IAAdRequest *adRequest =
[IAAdRequest build:^(id _Nonnull builder) {
    // Configure ad request if needed
	builder.spotID = @”NATIVE AD SPOT ID”;
	builder.timeout = 15;
}];

Declaring Your View Controller

Declare that your view controller conforms to the IANativeAdDelegate Protocol:

Objective-C
@interface ViewController() <IANativeAdDelegate>

For more information, see Unit Content Delegate Protocols.

Initializing the Placement

Initialize the IANativeAdSpot (placement) and pass your adRequest object:

Fetching the Ad

Native Ads are available only through SDK Bidding. In SDK Bidding, DT Exchange must first generate a token for the Mediation SDK to use when sending the request to server.

Generating the Token

The token can be generated upon SDK initialization.

Return type: NSString *

If an error occurs, the returned value is nil.

Loading the Ad

If DT Exchange wins the auction, load the ad with the signaldata (adm) that was received from the server:

For a complete list of Native Ads asset types, see the oRTB Specfication for Native Ads.

Registering Views for Interaction

You must register the views that will respond to user interaction, such as clicks. It is recommended to use the provided ViewTag enumeration for mapping views.

After setting the tags on your views, register them with the ad assets:

Last updated