iOS SDK - Ad Integration
Traditional Formats
Traditional formats are generally rectangular and they are inserted into the app’s content. To show this type of ads, you must create and instantiate a “BannerAdView”.
Before creating a “BannerAdView”, it is necessary to import certain controls, as it is shown in the sample code. Then, the “BannerAdView” is created inside an iframe, indicating the placement ID and the selected size.
For your reference, please read the following chart of suggested sizes:
Non-retina Smartphones | 300x50 / 320x50 |
Retina/High Resolution Smartphones | 640x100 |
Tablets | 728x90 / 300x250 |
The next example shows how to implement a 300x50 ad in an iOS Application activity.
Note that in the parameter placementId: the placement should indicate what`s needed to display. This example includes '186f6651be1753f8'.
#import 'FunViewController.h' |
Interstitial Formats
Interstitial formats are full screen and they are displayed over the app’s content. They include a solid color background and a close button at the top right corner, which allows the user to close the advertisement and continue navigating the application. To show this type of ads, you must create and instantiate an “InterstitialAd”.
Before creating an “InterstitialAd”, it is necessary to import certain controls, as it is shown in the sample code and implement the “adDidReceiveAd” delegate method. Then, the “InterstitisalAd” is created, indicating the placement ID and the selected size.
For your reference, please read the following chart of suggested sizes:
Smartphones | 300x250 / 320x480 |
Tablets | 900x500 / 1024x1024 |
The next example shows how to implement an Interstitial ad in an iOS Application activity.
Note that as in the previous example, in the parameter initwithPlacementId, it should indicate the placement to be displayed. This example includes 'dac0166035eda12f'.
#iimport 'FunViewController.h' |
Open landing pages in native browser
By default, the landing page opens in the application. If you would like it to open in the device’s native browser, include the following line:
banner.opensInNativeBrowser = true;
Logging Configuration
In order to visualize the requests sent to the adserver for debugging purposes, you can use the following methods to obtain the log’s output:
getANLogLevel
setANLogLevel
This is an example – View ANLogManager.h to obtain the different log levels:
[ANLogManager setANLogLevel:ANLogLevelDebug];