This guide is intended for publishers who want to monetize an iOS app with ADvantage. Integrating the ADvantage SDK into an app is the first step towards displaying ads and earning revenue. Once that's done, you can proceed to implement one or more of the supported ad formats.
Before you start integrating ADvantage into your project you should plan together with your client/sales team the exact positions and behaviour of each ad space inside of your app (e.g. which ad format you want to display). After that you must prepare the app to be able to show the ad spaces.
- Xcode Use Xcode 9.0 or higher
- iOS 10.0 or higher
- ADvantage Framework
- Valid license for the ADvantage SDK
Migration from 2.5.3 to 2.5.4 +¶
- Remove all framework dependencies related to ADvantage
- Remove the ADvantage static library
- Import it with CocoaPods or manually as the next steps describe it
Import the ADvantage SDK¶
- You add this command to your
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '<Your Target Name>' do pod 'ADvantage' end
- Then run
- Download the latest version of the SDK from the Download Section
- Extract the ZIP file
- With your Xcode project open, select your application project in the "Project Navigator" (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar.
- In the tab bar at the top of that window, open the "General" panel. Click on the
+button under the "Embedded Binaries" section.
- Select add another and search for ADvantageFramework.framework, it is easier to have it on your project folder since you do not need to set up a new framework path on "Build Settings".
If using the manual setup, remember that this is a fat framework, that mean it contains multiple architetures and some of those are not allowed by Apple when uploading a new version of your application, the file provided on our download section contain a script file that you can use to strip the framework when release your application.
Please check always our changelog to see what we changed in the latest version. In some very rare cases you have to adapt your implementation to be able to use the latest version.
Some advertisements needs some special permissions (e.g. GPS, write external storage and etc). ADvantage uses a two way permission mechanism for example if your app uses GPS but you don't want ads having access to it, you can permit it for each instance. By default all permissions are set as true, after you initialize one instance of ADvantage you can access or change it.
advantage.permissions.isContactAllowed = false
For more details about ADvantage permissions, visit our Permissions page.
License key and Ad positions¶
In order to show the advertisements, each ADvantage instance needs a valid license key, ad positions and site identifier.
License keyThe license key is a unique key for each app and platform provided by the ADvantage sales team.
SITE_IDThe site id represents a category/structure on the ad server. This information will be forwarded to the ad server. On some ad server this could be empty.
POSITIONThe position is linked to a specific ad position on the ad server and will be also forwarded.
As each ad server has it's own ad position settings, please contact us do get a detailed explanation.
Select an ad format¶
An ad space is the area where the advertisment will run and show up. An advertisement could be fullscreen or only use a small portion of the screen and entice the user to interact (touch, wipe, click and etc.) with the advertisement to forward the user to a landingpage (in the browser) or to the app store.
In the following sections you will see some examples how to implement ADvantage into your project.
Banner ads are rectangular image or text ads that occupy a spot within an app's layout. They stay on screen while users are interacting with the app, and can refresh automatically after a certain period of time. If you're new to mobile advertising, they're a great place to start.
Interstitials are fullscreen ads that cover the whole interface of an app until the ad will be closed by the user. They're best used at natural pauses in the flow of an app's execution, such as in between levels of a game or just after completing a task.