Before You Start Make Sure:
- App and Placement set up on Publisher Portal
- SDK is installed
- SDK is initialized
- Each Ad request has “Testing” status which enables it to test integrations.
Interscroller is a new ad unit, which combines the best elements of both Infeed and Interstitial ad units, in order to provide a unique, engaging user experience.
Interscroller enables you to insert an advertisement inside your app’s feed, while displaying ad-content in a fullscreen, in order to command higher CPM payouts.
The best performance can be reached using reveal effect and customizing colors of visible view-elements.
Interscroller ad unit supports both Video and Display (Static and Rich-Media) ad formats over portrait orientations.
- Display and Rich Media ad size = 320×480
- VAST Vertical Video ad size = 360×640
Interscroller is designed to be inserted into a UITableView or UIScrollView. Each Interscroller is associated with an UIView.
Interscroller loading process is handled in a different way than the other ad units:
DIOPlacement *placement = [[DIOController sharedInstance] placementWithId:@"YOUR_PLACEMENT_ID"]; DIOAdRequest *request = [placement newAdRequest]; DIOInterscrollerContainer container = [DIOInterscrollerContainer alloc] init]; [container loadWithAdRequest:request completionHandler:^(DIOAd *ad){ // Success [self.ad setEventHandler:^(DIOAdEvent event) { switch (event) { case DIOAdEventOnShown: NSLog(@"AD_EVENT_HANDLER: AD SHOWN"); break; case DIOAdEventOnFailedToShow: NSLog(@"AD_EVENT_HANDLER: AD FAILED TO SHOW"); break; case DIOAdEventOnClicked: NSLog(@"AD_EVENT_HANDLER: AD CLICKED"); break; case DIOAdEventOnClosed: NSLog(@"AD_EVENT_HANDLER: AD CLOSED"); break; case DIOAdEventOnAdCompleted: NSLog(@"AD_EVENT_HANDLER: AD COMPLETED"); break; } }]; } errorHandler:^(NSError *error) { // Failure }];
The main difference is that you don’t have to wait to receive a DIOAd object in order to access the InterscrollerUIView. In order to do so, use [container view]. See the example:
// TableView integration UIView *view = [self.container view]; if (cell.contentView.subviews.count > 0) [cell.contentView.subviews[0] removeFromSuperview]; [cell.contentView addSubview:view]; // ScrollView integration UIView *view = [self.container view]; [self.adsView addSubview:view]; // Recommended to set Interscroller height and/or top offset before request //to avoid any issues with dynamic UI elements DIOPlacement *placement = [[DIOController sharedInstance] placementWithId: self.placementId]; ((DIOInterscrollerPlacement*)placement).interscrollerSize = self.scrollView.frame.size.height; ((DIOInterscrollerPlacement*)placement).interscrollerOffset = [INT OFFSET];
When the UITableView requires the height of the row containing the Interscroller, you should return the UITableViewAutomaticDimension.
By default, the header of a Interscroller uses dark gray for background color and white for text. Also we recommend to change default background color to your custom, usually app main theme color. This can be changed as follows:
((DIOInterscrollerPlacement*)placement).headerBackgrounColor = [UIColor...]; ((DIOInterscrollerPlacement*)placement).headerColor = [UIColor...]; ((DIOInterscrollerPlacement*)placement).mainBackgrounColor = [UIColor...];
Default Interscroller height usually equal to table height. If you use any UI elements which can overlap ad’s view you may want to customise Interscroller height and top offset:
((DIOInterscrollerPlacement*)placement).interscrollerSize = YOUR_HEIGHT; ((DIOInterscrollerPlacement*)placement).interscrollerOffset = [YOUR_OFFSET];
You also can customise ad unit look and behaviour to improve UX:
((DIOInterscrollerPlacement*)placement).headerText = @"Sponsored"; ((DIOInterscrollerPlacement*)placement).dynamicHeader = @YES; ((DIOInterscrollerPlacement*)placement).showHeader = NO; ((DIOInterscrollerPlacement*)placement).reveal = NO; ((DIOInterscrollerPlacement*)placement).showTapHint = NO;
In order to control Interscroller behavior in case of switching between screens:
- Call [ad finish] to stop the ad and release the resources associated with it.
- Call [ad leave] to pause the video ad.
- Call [ad reenter] to resume the video ad.
Check the Sample App for a fully working example.
Headline
Before You Start Make Sure:
- App and Placement set up on Publisher Portal
- SDK is installed
- SDK is initialized
- Each Ad request has “Testing” status which enables it to test integrations.
Headline Video is a video only ad format that provides an option to attach the video player to the top of the feed UI as the user scrolls through their feed. Headline Video is designed to be inserted into a UITableView. Each Headline Video is associated with an UIView. However, the video loading process is handled in a different way than the other ad units:
#import <DIOSDK/DIOHeadlineContainer.h> #import <DIOSDK/DIOHeadlineView.h> ... @property (nonatomic, strong) DIOHeadlineContainer *container; @property (nonatomic, strong) DIOAd *ad; DIOPlacement *placement = [[DIOController sharedInstance] placementWithId:@"<YOU_PLACEMENT_ID>"]; DIOAdRequest *request = [placement newAdRequest]; self.container = [[DIOHeadlineContainer alloc] init]; [self.container loadWithAdRequest:request completionHandler:^(DIOAd *ad){ self.ad = ad; // Success [self.ad setEventHandler:^(DIOAdEvent event) { switch (event) { case DIOAdEventOnShown: NSLog(@"AD_EVENT_HANDLER: AD SHOWN"); break; case DIOAdEventOnFailedToShow: NSLog(@"AD_EVENT_HANDLER: AD FAILED TO SHOW"); break; case DIOAdEventOnClicked: NSLog(@"AD_EVENT_HANDLER: AD CLICKED"); break; case DIOAdEventOnClosed: NSLog(@"AD_EVENT_HANDLER: AD CLOSED"); break; case DIOAdEventOnAdCompleted: NSLog(@"AD_EVENT_HANDLER: AD COMPLETED"); break; } }]; } errorHandler:^(NSError *error) { // Failure }];
The main difference is that you don’t have to wait to receive a DIOAd object in order to access the Headline UIView. In order to do so use:
DIOHeadlineView *view = (DIOHeadlineView*) [self.container view];
Then if the view is not detached (i.e. it has not reached the top of the screen), you can add it to your UITableViewCell:
if (!view.detached) { // Add to cell }
When the UITableView requires the height of the row containing the Headline, you should return:
[(DIOHeadlineView*)[self.container view] height];
By default, the frame and text in Headline uses black/gray for background color and white for text. It is recommended to customize this color scheme to get the best appearance within your table:
((DIOHeadlinePlacement*)placement).backgroundColor = [UIColor...]; ((DIOHeadlinePlacement*)placement).backgroundColorSnap = [UIColor...]; ((DIOHeadlinePlacement*)placement).color = [UIColor...]; ((DIOHeadlinePlacement*)placement).colorSnap = [UIColor...];
And also there are some customisation options:
headlinePlacement.title = @"Some custom title headlinePlacement.buttonText = @"Click me"; headlinePlacement.headlineMode = YES; headlinePlacement.allowSwipeOff = NO; headlinePlacement.showAdvertiser = YES; headlinePlacement.headlineModeDuration = 25; //integer value
In order to control the behavior of Headline in the case of a user switching between screens:
- Call [self.ad finish] to stop the ad and release the resources associated with it.
- Call [self.ad leave] to pause the video ad.
- Call [self.ad reenter] to resume the video ad.
Check the Sample App for a fully-working example.
Interstitial
Before You Start Make Sure:
- App and Placement set up on Publisher Portal
- SDK is installed
- SDK is initialized
- Each Ad request has “Testing” status which enables it to test integrations.
Our Interstitial ad unit supports fullscreen ads of Video and Display (Static and Rich-Media) ad formats over portrait and landscape orientations. Ad Unit size is 480×320/320×480.
To show an Interstitial ad you need to proceed as follows:
[ad showAdFromViewController:self eventHandler:^(DIOAdEvent event){ switch (event) { case DIOAdEventOnShown: // integration code break; case DIOAdEventOnFailedToShow: // integration code break; case DIOAdEventOnClicked: // integration code break; case DIOAdEventOnClosed: // integration code break; case DIOAdEventOnAdCompleted: // integration code break; case DIOAdEventOnMuted: // integration code break; case DIOAdEventOnUnmuted: // integration code break; } }];
Note: After showing an ad you may not show it again.
Check the Sample App for a fully-working example.
Rewarded
- App and Placement set up on Publisher Portal
- SDK is installed
- SDK is initialized
- Each Ad request has “Testing” status which enables it to test integrations.
Rewarded ads are built based on Interstitial ad unit.
To apply Rewarded video mode activate Rewarded option for a Placement based on Interstitial ad unit via the Platform UI (it will make video ads non-skippable and the inventory will be marked for adevrtisers as “rewarded”):
To show a Rewarded ad you need to proceed as follows:
[ad showAdFromViewController:self eventHandler:^(DIOAdEvent event){ switch (event) { case DIOAdEventOnShown: // integration code break; case DIOAdEventOnFailedToShow: // integration code break; case DIOAdEventOnClicked: // integration code break; case DIOAdEventOnClosed: // integration code break; case DIOAdEventOnAdCompleted: // integration code break; case DIOAdEventOnMuted: // integration code break; case DIOAdEventOnUnmuted: // integration code break; } }];
Note: After showing an ad you may not show it again.
Check the Sample App for a fully-working example.