Banner ads occupy a spot within an app's layout, either at the top or bottom of the device screen. They stay on screen while users are interacting with the app, and can refresh automatically after a certain period of time.
When building and testing your apps, make sure you use test ads rather than live, production ads. Failure to do so can lead to the suspension of your account. The easiest way to load test ads is to use our dedicated test ad unit ID for app banner ads:
63a573861ac5f
It's been specially configured to return test ads for every request, and you're free to use it in your own apps while coding, testing, and debugging. Just make sure you replace it with your own ad unit ID before publishing your app.
Create a Adx3BannerAdView
Banner ads are displayed in Adx3BannerAdView objects, so the first step toward integrating banner ads is to include an Adx3BannerAdView in your view hierarchy. This is typically done either with the interface builder or programmatically.
Interface Builder
An Adx3BannerAdView can be added to a storyboard or XIB file like any typical view. When using this method, be sure to add width and height constraints to match the ad size you'd like to display. For example, when displaying a banner (250x150), use a width constraint of 250 points, and a height constraint of 150 points.
Programmatically
An Adx3BannerAdView can also be instantiated directly. Here's an example of how to create an Adx3BannerAdView, aligned to the bottom center of the safe area of the screen, with a banner size of 250x150:
Once the Adx3BannerAdView is in place, it's time to load an ad. This is done by calling loadRequestWithPlacementID:userId: delegate on an Adx3BannerAdView object: