Before You Start Make Sure:
- at least one App and Placement are added on Developer Portal
- SDK is installed
- SDK is initialized
- Placements have "Testing" status in order to get a test ad, for testing the integration
1. Requesting ads
To request an ad you should retrieve the Placement object from the Controller.
DIOPlacement *placement = [[DIOController sharedInstance] placementWithId:@"5678"];
Note:
Do not create a new DIOPlacement instance directly.
Then issue a new DIOAdRequest object from the Placement object:
DIOAdRequest *request = [placement newAdRequest];
To execute an Ad Request (asynchronous operation):
[request requestAdWithAdReceivedHandler:^(DIOAdProvider *adProvider) {
// Success
} noAdHandler:^(NSError *error){
// Failure
}];
You may add data about the user or the context of the ad to the Ad Request. As a best practice, we advise our publishers to add as much user data to their Ad Requests as possible. The reason is, this gives advertisers visibility into the parameters of each user within your app, and in doing so, allows advertisers to bid more intelligently. Meaning a higher CPM payout for you, the developer.
[request setContentKeywords:@[@"house of cards", @"ronaldo"]];
In case you are requesting Banner or Medium Rectangle ads, specify the expected position of the ad on a screen as follows:
[request setPosition:DIOBannerPositionAboveTheFold];
[request setPosition:DIOBannerPositionBelowTheFold];
Note: Ad Request properties should be added prior to executing the ad request.
2. Loading ads
Use the DIOAdProvider to load the ad:
[adProvider loadAdWithLoadedHandler:^(DIOAd *ad) {
// Success
} failedHandler:^(NSError *error){
// Failure
}];
If you previously requested ad attributes like 'Advertiser Name' and 'Advertiser Click URL', you can access them as follows:
NSString *name = ad.avertiserName;
NSString *clickURL = ad.advertiserClickURL;
A/B testing labels can be defined via:
[request setLabels:@[@"blue", @"red"]]
Note:
We provide GDPR compliance through the IAB’s GDPR Transparency and Consent framework. If you use a CMP that implements this IAB standard, we will be able to pick the consent state from your integrated CMP and apply it in our ad serving.
Next steps:
Now you can follow our integration guide to implement our supported Ad Units:
Comments
0 comments
Please sign in to leave a comment.