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 = 320x480
- VAST Vertical Video ad size = 360x640
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
} 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];
view.translatesAutoresizingMaskIntoConstraints = NO;
if (cell.contentView.subviews.count > 0)
[cell.contentView.subviews[0] removeFromSuperview];
[cell.contentView addSubview:view];
[self.container setConstraintForIndexPath:indexPath];
// ScrollView integration
UIView *view = [self.container view];
[self.adsView addSubview:view];
[self.container setConstraintForScrollView];
view.translatesAutoresizingMaskIntoConstraints = NO;
// 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];
Important:
Do not try to set additional constraints to ad's view or cell content view.
When the UITableView requires the height of the row containing the Interscroller, you should return the UITableViewAutomaticDimension.
By default, the header and footer of a Interscroller use 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).footerBackgrounColor = [UIColor...];
((DIOInterscrollerPlacement*)placement).footerColor = [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 disable dynamic Interscroller header which enabled by default and can improve UX:
((DIOInterscrollerPlacement*)placement).dynamicHeader = 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.
In order to detect if Interscroller was clicked, subscribe to the <DIOAdClickDelegate> protocol and then define yourself as a delegate via:
ad.clickDelegate = self;
Finally, implement the following to be notified whenever relevant:
- (void)onAdClicked:(DIOAd*)ad;
Check the Sample App for a fully-working example.
Comments
0 comments
Please sign in to leave a comment.