All-in-One

To integrate all ad types in one integration, ensure you have integrated the IASDKCore Libraries. Configure the ad placement and its controllers, create an Ad Request, and then fetch and display the ad.

Importing the SDK

Import the following IASDKCore module into your desired view controller:

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

Creating Properties

Create properties for all types of controllers and content controllers:

Objective-C
@property (nonatomic, strong) IAAdSpot *adSpot; 
@property (nonatomic, strong) IAViewUnitController *viewUnitController; 
@property (nonatomic, strong) IAFullscreenUnitController *fsUnitController; 
@property (nonatomic, strong) IAMRAIDContentController *mraidContentController;
@property (nonatomic, strong) IAVideoContentController *videoContentController;

Set global variables for SDK bidding provided in IASDKCore shared instance:

  • userData

  • muteAudio

  • mediationType

  • debugger

Example:

Creating the User Data Object

Optionally, create an IAUserData object for better ad targeting:

circle-info

The build: method is synchronous and runs on the same thread that it is invoked from, similar to iOS's enumerateObjectsUsingBlock. As a result, special memory management like weak references are not needed inside the block.

Initializing the Ad Request Object

circle-info

This step is not mandatory for SDK Bidding mediation.

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

Initializing the Controller

Initialize the IAMRAIDContentController:

Declaring Your View Controller

Declare that your view controller conforms to the IAMRAIDContentDelegate protocol:

For more information, see HTML/MRAID Delegate Protocols.

Initializing the Video Content Controller

Initialize the IAMVideoContentController:

Declaring Your View Controller

Declare that the video content controller conforms to the IAVideoContentDelegate protocol:

Objective-C

For more information, see Video Content Delegate Protocols.

Initializing the View Unit Controller

Initialize the IAViewUnitController:

Initializing the Full-Screen Unit Controller

Initialize the IAFullscreenUnitController:

Declaring the View Unit Controller and the Full Screen Unit Controller

Declare that the video content controller and full screen unit conform to the IAVideoContentDelegate protocol:

For more information, see Unit Content Delegate Protocols.

Initializing the Placement

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

Fetching the Ad

The way in which the ad is fetched depends on the mediation type — Waterfall or SDK Bidding.

Fetching the Ad for Waterfall

In Waterfall mediation, use fetchAdWithCompletion: and showAdAnimated:completion to fetch the ad:

Fetching the Ad for 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:

Last updated