Wiki
Clone wikiAATKit iOS / AATKit2 / MultiSizeBannerIntegration
AddApptr Multi Size Banner Placements
Index:
- Project Setup
- AATKit Initialisation
- Banner Integration (Static API)
- Banner Integration (Request/Response API)
- Banner Cache Integration
- Multi-Size Banner Integration
- Fullscreen Integration
- APP Open Integration
- Native Ads Integration
- Native Ads Integration - special ad network characteristics
- Promo Screen
- Sample
- Disable App Transport Security (ATS)
- Advanced Features
- Targeting
- Rewarded Video
- Frequency Capping
- Header documentation
- Important Remarks
- AATKit's Size within your app
- What is an AdSpace?
- Network-specific Information
- Statistics Delegate
- Listen to impression level information
- AATKit AdMob custom events adapter (>= 2.77.x)
AATKit Changelogs
What is a Multi-Size Banner Placement? (Code Sample)
Multi-Size banner placements can present banner of varying sizes. For instance it is possible to display a banner of the standard size 320x53, followed by a medium rect angle of size 300x250 within the same placement.
(Note: the green background is an ad container (UIView), into which the placement view is added. It represents the space that is reserved for a multi-size banner placement's view.)
Meta Information
The following sizes are supported for Multi-Size Banner.
- 300x250
- 320x53
- 320x75 (DFP only)
- 320x100 (DFP only)
- 320x150 (DFP only)
- 468x60
- 768x90
Please contact the AddApptr support via support@addapptr.com, in order to let us know which formats you would like to use in your app. The AddApptr team will setup the backend accordingly.
The Multi-Size Banner Placement Interface
Creating a Multi-Size Banner
A Multi-Size Banner is created by calling the method:
#!objective-c + (nonnull id) createPlacementWithName:(nonnull NSString *) placementName andType:(AATKitAdType)type
AATKitBannerMultiSize
.
This process is just the same as for the normal banner placement.
Example:
Objective-C:
#!objective-c [AATKit createPlacementWithName:@"MultiSizeBanner" andType:AATKitBannerMultiSize];
#!swift AATKit.createPlacement(withName: "MultiSizeBanner", andType: .bannerMultiSize)
Requesting an Ad
A Multi-Size Banner supports manual and automatic reload. For manual reload:
#!objective-c + (bool) reloadPlacement:(nonnull id) placement;
For automatic reload:
#!objective-c + (void) startPlacementAutoReload:(nonnull id) placement;
Reacting on the Multi-Size Banner Callback
When a Multi-Size Banner is successfully loaded a new callback is invoked.
#!objective-c - (void) AATKitHaveAdOnMultiSizeBanner:(nonnull id) placement withView:(nonnull UIView*) placementView;
placementView
provided via the callback. The AATKit is providing an autoreleased placementView
instance.
Also, since the AATKit has no ownership of any (potential) previous placementView
, the programmer may keep the old instance around in case of a animation or alike.
Objective-C:
#!objective-c - (void)AATKitHaveAdOnMultiSizeBanner:(id)placement withView:(UIView *)placementView { UIView *oldAdView = self.currentlyShownAdView; self.currentlyShownAdView = multiSizeBannerView; ... }
#!swift func aatKitHaveAd(onMultiSizeBanner placement: AATKitPlacement, with placementView: UIView) { let oldView = currentlyShownAdView currentlyShownAdView = placementView ... }
For successfully loaded Multi-Size Banner ads the callback - (void) AATKitHaveAd:(nonnull id) placement;
will not be invoked.
In case no ad could be loaded on a Multi-Size Banner placement, the callback - (void) AATKitNoAds:(nonnull id) placement;
is invoked. For this case, no new callback has been introduced.
Displaying a Multi-Size Banner
In order to show a Multi-Size Banner, it's view has to be positioned on the screen, similar to regular banner placements. Since a new placement view is provided each time the Multi-Size Banner specific callback is invoked, a potential previous placement view has to be disposed by the programmer, and a new one has to be positioned. Since the UIView frame can change each time Multi-Size Banner callback is invoked the programmer has to adapt the space available according to the view's frame.
You can find a Multi-Size Banner example app, which works with an animation, here.
##Click Here To Provide Feedback###
back (Banner Integration)
next (Fullscreen Integration)
Updated