SDK Integration | Appodeal

App key

Appodeal iOS SDK 2.0 documentation

Download SDK

1.1 You can download a release version of Appodeal SDK here

1.2 You can download a demo project for the release version here

iOS (Swift) integration

Preparing Your Apps

Set up the following keys in your app’s info.plist:

  • NSAllowsArbitraryLoads: YES
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

CocoaPods integration

1. To download and integrate the Appodeal iOS SDK into your project using Cocoapods, add the following line to your project's Podfile:

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal', '~> 2.0'
end

Also add use_frameworks! to your Podfile.

2. Make pod install to install CocoaPods dependencies or pod update to update. If you don`t have an installed pod - Install CocoaPods to simplify dependency management

sudo gem install cocoapods

If you have problems with versions of pods please run following code:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

If the official repo doesn't respond, you can add aline to your podspec and update pods from the Appodeal mirror repo

source 'https://github.com/appodeal/CocoaPods.git'
source 'https://github.com/CocoaPods/Specs.git'

3. You can add Pods with custom ad types:

Interstitial

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal/Interstitial', '~>2.0'
end

Banner and MREC

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal/Banner', '~>2.0'
end

Rewarded video (NonSkippable video)

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal/Video', '~>2.0'
end

Native

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal/Native', '~>2.0'
end

Manual integration

1. Download the latest FAT IOS SDK version and extract the latest version of Appodeal iOS SDK.

2. Open your project in Xcode, then drag and drop Appodeal.framework and Resources folder onto your project or workspace (use the "Product Navigator view") and choose "Copy items into destination group's folder" and click "Finish".

Copy+
Add+fat

3. Add other frameworks and Flags that the SDK requires

Appodeal iOS SDK works on >= iOS 8.0 version and is compatible with both ARC and non-ARC projects. It depends (Project Settings -> Build Phases -> Link Binary With Libraries) on the following Apple frameworks:'

  • AdSupport
  • AudioToolbox
  • AVFoundation
  • CFNetwork
  • CoreGraphics
  • CoreImage
  • CoreLocation
  • CoreMedia
  • CoreMotion
  • CoreTelephony
  • EventKitUI
  • GLKit
  • libc++
  • libsqlite3.dylib
  • libxml2.2.dylib
  • libz.dylib
  • MediaPlayer
  • MessageUI
  • MobileCoreServices
  • QuartzCore
  • Security
  • StoreKit
  • SystemConfiguration
  • Twitter
  • UIKit
  • WebKit

Linker Flags: Click Project -> Build Settings -> Search for other linker flags -> Add -ObjC

Ios xcode linker

SDK Initialization

Import <Appodeal/Appodeal.h> in AppDelegate.m and start sdk initialization with one of these methods:

let adTypes: AppodealAdType = [.interstitial, .rewardedVideo]
Appodeal.initializeWithApiKey("fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f", types: types)

in didFinishLaunchingWithOptions method.

AppodealAdTypeSkippableVideo - deprecated Ad type. Appodeal Ad type AppodealAdTypeInterstitial now include AppodealAdTypeSkippableVideo

Display ad

To display ad you need to call the following code:

Appodeal.showAd(AppodealShowStyle.interstitial, rootViewController: self)

To display interstitial: use Appodeal.showAd(AppodealShowStyle.interstitial, rootViewController: self)

To display rewarded video: use Appodeal.showAd(AppodealShowStyle.rewardedVideo, rootViewController: self);

To display non-skippable video: use Appodeal.showAd(AppodealShowStyle.nonSkippableVideo, rootViewController: self)

To display banner at the bottom of the screen: use Appodeal.showAd(AppodealShowStyle.bannerBottom, rootViewController: self);

To display banner at the top of the screen: use Appodeal.showAd(AppodealShowStyle.bannerTop, rootViewController: self)

You can also display an ad with different show styles at the same time and the ad with the highest eCPM will be shown:

let showStyles: AppodealShowStyle = [.interstitial, .rewardedVideo]
Appodeal.showAd(showStyles, rootViewController: self)

Interstitial Integration

Interstitial ads provide full-screen experiences, commonly incorporating rich media to offer a higher level of interactivity than banner ads. Adding one to your app takes just a few lines of code.

Basic integration

import UIKit
Import Appodeal

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    Appodeal.showAd(AppodealShowStyle.interstitial, rootViewController: self)
  }

}

Delegate callbacks (optional)

import UIKit
import Appodeal

class ViewController: UIViewController, AppodealInterstitialDelegate {
  override func viewDidLoad() {
    super.viewDidLoad()
    Appodeal.setInterstitialDelegate(self)
  }

    
    func interstitialDidLoadAdisPrecache(_ precache: Bool){
         NSLog("Interstitial was loaded")
    }
    func interstitialDidFailToLoadAd(){
         NSLog("Interstitial failed to load")
    }
    func interstitialWillPresent(){
         NSLog("Interstitial will present the ad")
    }
    func interstitialDidDismiss(){
         NSLog("Interstitial was closed")
    }
    func interstitialDidClick(){
         NSLog("Interstitial was clicked")
    }

}

Remember to set the delegate before making the request for an ad:

Appodeal.setInterstitialDelegate(self)

Display interstitial

Appodeal.showAd(AppodealShowStyle.interstitial, rootViewController: self)

Non skippable video integration

Basic integration

import UIKit
import Appodeal

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    Appodeal.showAd(AppodealShowStyle.nonSkippableVideo, rootViewController: self)
  }
}

Delegate callbacks (optional)

AppodealNonSkippableVideoDelegate protocol includes a variety of optional methods that you can use to be notified of events, e.g. when an video ad has successfully loaded, or when an video ad was completed. To handle these events you need to implement any of the optional methods of AppodealNonSkippableVideoDelegate protocol.

import UIKit
import Appodeal

class ViewController: UIViewController, AppodealNonSkippableVideoDelegate {

  override func viewDidLoad() {
    super.viewDidLoad()
    // set delegate
    Appodeal.setNonSkippableVideoDelegate(self)
  }

    func nonSkippableVideoDidLoadAd(){
         NSLog("video ad was loaded")
    }
    func nonSkippableVideoDidFailToLoadAd(){
         NSLog("video ad failed to load")
    }
    func nonSkippableVideoDidPresent(){
          NSLog("video ad was presented");
    }
    func nonSkippableVideoWillDismiss(){
          NSLog("video ad was closed");
    }
    func nonSkippableVideoDidFinish(){
          NSLog("video ad was fully watched");
    }
}

Remember to set the delegate before making the request for an ad:

Appodeal.setNonSkippableVideoDelegate(self)

Display Non skippable Video

Appodeal.showAd(AppodealShowStyle.nonSkippableVideo, rootViewController: self)

Rewarded video integration

Basic integration

import UIKit
import Appodeal

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    Appodeal.showAd(AppodealShowStyle.rewardedVideo, rootViewController: self)
  }
}

Delegate callbacks (optional)

AppodealRewardedVideoDelegate protocol includes a variety of optional methods that you can use to be notified of events, e.g. when an video ad has successfully loaded, or when video ad was completed with reward (amount and name can be configured via Appodeal Dashboard). To handle these events you need to implement any of the optional methods of AppodealRewardedVideoDelegate protocol.

import UIKit
import Appodeal

class ViewController: UIViewController, AppodealRewardedVideoDelegate {

  override func viewDidLoad() {
    super.viewDidLoad()
    // set delegate
    Appodeal.setRewardedVideoDelegate(self)
  }

    func rewardedVideoDidLoadAd(){
         NSLog("video ad was loaded")
    }
    func rewardedVideoDidFailToLoadAd(){
         NSLog("video ad failed to load")
    }
    func rewardedVideoDidPresent(){
          NSLog("video ad was presented");
    }
    func rewardedVideoWillDismiss(){
          NSLog("video ad was closed");
    }
    func rewardedVideoDidFinish(_ rewardAmount: UInt, name rewardName: String!){
          NSLog("video ad was fully watched");
    }
}

Remember to set the delegate before making the request for an ad:

Appodeal.setRewardedVideoDelegate(self)

Display Rewarded Video

Appodeal.showAd(AppodealShowStyle.rewardedVideo, rootViewController: self)

S2S Rewards Callbacks

To secure your apps economy we offer S2S reward callbacks. To validate each reward you need to setup a callback URL on your server that will receive reward information. We will pass user data to your callback URL that you will need to validate and adjust user balance accordingly.

1. Create reward callback URL on your server that will receive reward information.

2. Fill create URL and encryption key in the app settings in your dashboard.

3. Reward callback will be sent to your URL using GET request with two parameters:

{http:/example.com/reward}?data1={data1}&data2={data2}

4. Your URL should decrypt the data and validate it.

5. Check impression_id for uniqueness and store it in your system to prevent duplicate transactions.

We offer sample script in PHP, Ruby, Java and Python 3 to decrypt the data. If you need samples in other languages, please contact our support and we will provide it for you.

Sample in PHP: reward.php

Sample in Ruby: reward.rb

Sample in Java: reward.java

Sample in Python 3: reward.py

Banner Integration

Basic integration

Banner is a singleton now, if you are using bannerTop or bannerBottom on different controllers then SDK will use the same banner instance

import UIKit
import Appodeal

class ViewController: UIViewController {

  override func viewDidLoad() {
    super.viewDidLoad()

    // show banner at the bottom of the screen
    Appodeal.showAd(AppodealShowStyle.bannerTop, rootViewController: self)
  }
}

Delegate callbacks (optional)

AppodealBannerDelegate protocol includes a variety of optional callbacks that you can use to be notified of events, e.g. when an ad banner has successfully loaded, or when an ad banner is about to appear. To handle callbacks, you need to implement AppodealBannerDelegate protocol.

import UIKit
import Appodeal
class ViewController: UIViewController, AppodealBannerDelegate {

  override func viewDidLoad() {
    super.viewDidLoad()
    //Remember to set the delegate before making the request for an ad
    Appodeal.setBannerDelegate(self)
  }

    func bannerDidLoadAdIsPrecache(_ precache: Bool){
        NSLog("banner was loaded")       
    }
    func bannerDidFailToLoadAd(){
         NSLog("banner failed to load");        
    }
    func bannerDidClick(){
        NSLog("banner was clicked")
    }
    func bannerDidShow(){
        NSLog("banner was shown")
    }
}

Remember to set the delegate before making the request for an ad:

Appodeal.setBannerDelegate(self)

Banner Position on the Screen

Appodeal supports the following banner positions:

AppodealShowStyleBannerBottom - pins ad banner at bottom of the screen

AppodealShowStyleBannerTop - pins ad banner at top of the screen

For example:

// pin ad banner at Bottom of the screen
Appodeal.showAd(AppodealShowStyle.bannerBottom, rootViewController: self)

// pin ad banner at Top of the screen
Appodeal.showAd(AppodealShowStyle.bannerTop, rootViewController: self)

You can also add an Appodeal banner to your view hierarchy manually.

For example:

override func viewWillAppear(animated: Bool) {
  super.viewWillAppear(animated);

  self.view.addSubview(Appodeal.banner())
  Appodeal.banner().frame = CGRect.init(x: 0, y: 0, width: self.view.bounds.size.width, height: APPODEAL_BANNER_HEIGHT)
}

To remove banner from your view hierarchy:

Appodeal.hideBanner()

Advanced Banner View Integration

If basic integration is not appropriate due to the complex views hierarchy of your app, you can use AppodealBannerView UIView subclass to integrate banners.

To increase fillrate it's highly recommended to use one banner instance in the application (to move it from one view controller to another)

import UIKit
import Appodeal

class YourViewController : : UIViewController, AppodealBannerViewDelegate {

  override func viewDidLoad () {
    super.viewDidLoad()
    // required: init ad banner
    var bannerView: AppodealBannerView!
    bannerView.init(size: kAppodealUnitSize_320x50, rootViewController: self);

    // optional: set delegate
    bannerView.setDelegate(self);

    // required: add banner to superview and call -loadAd to start banner loading
    self.view addSubview(bannerView);
    bannerView.loadAd();
  }

  // optional: implement any of AppodealBannerViewDelegate methods
    func bannerViewDidLoadAd(_ bannerView: APDBannerView!){
        NSLog("Banner view was loaded")
    }

    func bannerViewDidRefresh(_ bannerView: APDBannerView!){
        NSLog("banner view was refreshed")
    }
    func bannerView(_ bannerView: APDBannerView!, didFailToLoadAdWithError error: Error!){
        NSLog("banner view failed to load")
    }
    func bannerViewDidInteract(_ bannerView: APDBannerView!){
        NSLog("banner view was clicked")
    }
}

MREC Integration

Class "AppodealMRECView" is a subclass of "AppodealBannerView". 'AppodealMRECView' has size 300x250.

import UIKit
import Appodeal

class YourViewController : : UIViewController, AppodealBannerViewDelegate {

  override func viewDidLoad () {
    super.viewDidLoad()
    // required: init ad banner
    var mrec: AppodealMRECView!
    mrec.init(rootViewController: self);

    // optional: set delegate
    mrec.setDelegate(self);

    // required: add banner to superview and call -loadAd to start banner loading
    self.view addSubview(mrec);
    mrec.loadAd();
  }

  // optional: implement any of AppodealBannerViewDelegate methods
    func bannerViewDidLoadAd(_ bannerView: APDBannerView!){ 
         NSLog("banner view was loaded")   
    }
    func bannerViewDidRefresh(_ bannerView: APDBannerView!){  
         NSLog("banner view was refreshed")     
    }
    func bannerView(_ bannerView: APDBannerView!, didFailToLoadAdWithError error: Error!){
         NSLog("banner view failed to load")   
    }
    func bannerViewDidInteract(_ bannerView: APDBannerView!){  
         NSLog("banner view was clicked")   
    }
}

Skippable Video Integration

Skippable Video is now deprecated.

Interstitial now includes skippable video.

Native Ads Integration

A "Native Ad" gives you the opportunity to design and control the mobile app ad exactly as you would like it. Using Native Ads, you can create an ad experience that perfectly fits your application's design, flow, content and functionality.

Basic integration

Import the Appodeal in your view controller and add the following lines to the header file for each view in which you would like to show an ad.

import UIKit
import Appodeal

class YourViewController : UIViewController, APDNativeAdLoaderDelegate {
 var apdLoader : APDNativeAdLoader!
}

Initialize Appodeal native ad service object. You can do this in viewDidLoad method and call loadAd method.

- (void)viewDidLoad{
  _adLoader = [APDNativeAdLoader new];
  [_adLoader loadAdWithType:APDNativeAdTypeAuto];
}

Or method with capacity

- (void)viewDidLoad{
  _adLoader = [APDNativeAdLoader new];
  [_adLoader loadAdWithType:APDNativeAdTypeAuto capacity:5];
}

NOTE: if you are using native ads with UITableView then you should attach it to contentView of current cell where the native ad is presented.

Using NativeAd delegates

Set your view controller as a delegate so it is able to receive callbacks from the native ad service.

Add the APDNativeAdLoaderDelegate protocol and set delegate

import UIKit
import Appodeal

class YourViewController : UIViewController, APDNativeAdLoaderDelegate {
 var apdLoader : APDNativeAdLoader! 

...

   override func viewDidLoad(){
     apdLoader = APDNativeAdLoader.init()
     apdLoader.delegate = self;
     apdLoader.loadAd(with: APDNativeAdType.auto)
   }

...

}

Implement the following functions:

    func nativeAdLoader(_ loader: APDNativeAdLoader!, didLoad nativeAds: [APDNativeAd]!){

    }
    func nativeAdLoader(_ loader: APDNativeAdLoader!, didFailToLoadWithError error: Error!){
        
    }

Appodeal SDK also provides native ad presentation protocol to track event when native ads was shown or clicked:

class YourViewController: UIViewController, APDNativeAdPresentationDelegate

Implement the following functions:

func nativeAdWillLogImpression(_ nativeAd: APDNativeAd!) {
   NSLog("native ad was shown")
}    
func nativeAdWillLogUserInteraction(_ nativeAd: APDNativeAd!) {
   NSLog("native ad was clicked")
}

Native complain button

You can choose complain button position. Default complain button position - center

// use BEFORE attach
self.nativeAd.complainButtonPositon(.complainBottom)
self.nativeAd.attach(to: self.view, viewController: self)

Native Ad Queue

Native AdQueue is a new feature of using native ads in Appodeal SDK. You don't need to download native ads manually anymore. All you have to do is to grab some ads from adQueue and adQueue will load new ads automatically.

Native Ad Queue initialization

import Appodeal
class ViewController: UIViewController {
    var adQueue : APDNativeAdQueue!

You can initialize nativeAdQueue with custom native count and type

class ViewController: UIViewController {
    var adQueue : APDNativeAdQueue!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.adQueue = APDNativeAdQueue.init()
        self.adQueue.setMaxAdSize(5)
        self.adQueue.loadAd(of: .video)
}
}

Using NativeAdQueue delegates

class ViewController: UIViewController, APDNativeAdQueueDelegate { }

Implement the following functions:

func adQueueAdIsAvailable(_ adQueue: APDNativeAdQueue!, ofCount count: Int) {
     NSLog("native ads are available to be shown")
}

func adQueue(_ adQueue: APDNativeAdQueue!, failedWithError error: Error!) {
     NSLog("native ads loading failed")
}

Get all native ad from nativeAdQueue

import UIKit
import Appodeal

class ViewController: UIViewController, APDNativeAdQueueDelegate {
    var adQueue : APDNativeAdQueue!
    var nativeAds = [APDNativeAd]()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.adQueue = APDNativeAdQueue.init()
        self.adQueue.delegate = self
        self.adQueue.setMaxAdSize(5)
        self.adQueue.loadAd(of: .video)
    }

    func adQueueAdIsAvailable(_ adQueue: APDNativeAdQueue!, ofCount count: Int) {
        self.nativeAds = adQueue.getNativeAds(ofCount: 5)
    }


}

Using Media View

APDNativeAd provides video ads. You can show them with APDMediaView. That object created with native ad and rootViewController. APDMediaView uses image from native ad as placeholder. After this you can set boolean flags to mediaView: skippable and muted . If you set skippable to YES, then this video can be skipped after 5 seconds. You can add a custom mute button on media view and enabled/disabled sound playable video. When the video is completed, media view will show the image. If you use the APDMediaView as the main Image, you can set the type of media view.

func nativeAdLoader(_ loader: APDNativeAdLoader!, didLoad nativeAd: APDNativeAd!){

        let mediaView = APDMediaView.init(frame: CGRect.init(x: 0, y: 0, width: 100, height: 100))
        self.view.addSubview(mediaView);
        mediaView.skippable = true
        mediaView.muted = false
        mediaView.setNativeAd(nativeAd, rootViewController: self)
}

You can set sound to mute while playing video. For example, you can unmute ad by usage:

  mediaView.muted = false

Appodeal Ad Choices View

Most ads networks require the use of data privacy view in native ad. APDNativeAd returns instance of UIView that is ad choices view. This view must not overlap any assets or be overlapped by any assets. The size of this icon should be 24x24 or more. If this element not required by the networks ad choices view, it will return nil.

class YourViewController : UIViewController {
  func nativeAdLoader(_ loader: APDNativeAdLoader!, didLoad nativeAd: APDNativeAd!){
        
        let adChoices = nativeAds.first?.adChoicesView
        adChoices!.frame = CGRect.init(x: 0, y: 0, width: 24, height: 24)
        self.view.addSubview(adChoices!)
  }
}

Appodeal Native Ad Structure

Name of field Required? Description
NSString *title; required field title of ads
NSString *subtitle unrequired field subtitle of ads
NSString *descriptionText unrequired field description of ads
NSString *callToActionText required field call to action text
NSString *contentRating unrequired field content rating
NSNumber *starRating unrequired field means of star rating
APDImage *mainImage unrequired field contains image size and url
APDImage *iconImage required field contains icon size and url
UIView *adChoicesView required field contains adChoicesView

All of the fields of native ad marked as mandatory must be displayed.

Every ad should have a sign that clearly indicates that it is an ad. For example "Ad" or "Sposored".

Provided images can be resized to fit your ad space but should not be significantly distorted or cropped.

Native object description

NSString * title : Title of native ad. Mandatory. Minimum 25 symbols of title should always be displayed. You can add ellipsis at the end if the title is longer.

NSString * subtitle : Subitle of native ad. Optional.

NSString * callToActionText : Call to action text. Mandatory. Shoud be displayed without truncation on a visible button.

NSString * descriptionText : Text description of native ad. Optional. If you choose to display the description you should display minimum 75 characters. You should limit number of lines displayed suitable for your app. You can add ellipsis at the end.

NSNumber * starRating : Rating of the app in [0-5] range.

NSNumber * contentRating : Content rating of the ad. Optional.

APDImage * iconImage : Icon. Either icon or image is mandatory to display.

APDImage * mainImage : Image. Either icon or image is mandatory to display.

UIView * adChoicesView : If returned view is not null it is mandatory to display it in any corner of native ad. Only used for Facebook to display AdChoices icon.

Segments and Placements

Segments are divisions of your user base, which share commonalities such as age, sex, location, interests, income bracket, etc. There are several ways to segment users into groups including the use of demographics, in-app behavior or engagement analysis, interests and personal profile data, and location.

Once user segments have been created, they can then be analyzed and used to configure ads.

To create new segment, go here

1) Enter its name

2) Select match rule:

  • ALL - user will only match to segment if all of the rules will apply to them
  • ANY - user will match to segment if any of the rules will apply to them

3) Select platform

4) Select rules that apply to the user, you can select as many rules as you want or none at all:

  • App - matches users in one or multiple versions of your apps
  • SDK version - matches users that only use specified SDK version or range of versions
  • Device type - matches users that using tablet and/or phone
  • App version - matches users that only use specified app version or range of versions
  • Country - matches users only from specified countries
  • OS version - matches users that are using devices with specified OS version
  • Session count - matches users that had specified number of sessions in your app
  • Average session length - matches users with specified that spent specified average session length in your app
  • Device model - matches user on specified devices
  • Connection type - matches users using specified connection type
  • Gender, Age, Occupation, Relation - matches users with specified Gender, Age, Occupation, Relation
  • Last session time - matches users that last used your app at the specified time
  • Bought inapps - matches users that made in-app purchases (tracked using Appodeal.trackInAppPurchase method)
  • Inapp sum, Inapp sum all apps - matches users the spent specified amount in your the app or all apps (only counts in-apps tracked using Appodeal.trackInAppPurchase method)
  • Hour, Day - matches users using the app at the specified time
  • NSUInteger, CGFloat, NSString, Bool - matches users using custom parameters. You can set custom parameters in SDK using Appodeal.setCustomRule([AnyHashable : Any]!) method, i.e. Appodeal.setCustomRule(["levels_played" : 3]). To match users that played more than 3 level select Int and enter name "levels_played", select operator > and value 3

5) Segment settings. You can apply following settings for each segment. They will apply to all users matched to that segment.

  • Disable networks - Allows you to disable any network for an ad type it supports.
  • Min pricefloor - Allows you to set minimum price floor for each ad type. Ads with eCPM lower than price floor will not be filled.
  • Overriden eCPM - Allows you to override eCPM of each network for ad type. High eCPM(100+) will ensure that the network will be at the top of the waterfall and get the first fill. Low eCPM (close to 0) will ensure that the network acts as backfill.

If you have no segments all users will be matched to hidden default segment.

If you have multiple segments, their order is important. Only the first segment in which rules are matched to the user will apply. All of the rest will be ignored.

Placements

Appodeal SDK allows you to tag each impression with different placement.

To check if an impression is available for a given placement, use:

Appodeal.canShowAd(.interstitial, forPlacement: "placement")

To show an ad with placement, you have to call show method like this:

Appodeal.showAd(.interstitial, forPlacement: "placement", rootViewController: controller)

Get reward for placement

Appodeal.reward(forPlacement: "placement")

Placement can be used for separating your revenue by placement in our dashboard and determining which placement earns you more money.

Also you can configure your impression logic for each placement. You can use the following Placement settings:

  • Disable ads - disables ads completely for that placement.
  • Disable as types - disables specific ad type for a placement. If you integrated to show Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO you can disable interstitials or rewarded video for the placement.
  • Reward - you can set a reward amount and name which will be passed in onRewardedVideoFinished callback for all videos shown with this placement.
  • Impression/Refresh period - you can set the impression period (in seconds) for interstitials and rewarded video shown with the placement. If the period between two impression is less than the impression period, the second impression will not be shown and the Appodeal.show method will return false. For banners and MRECs you can set their refresh period.
  • Min pricefloor - Allows you to set minimum price floor for each ad type. Ads with eCPM lower than price floor will not be shown and Appodeal.show method will return false.

Placements can only be used as part of an existing segment. If you only want to use placements, create one segment for each platform without any rules and match rule ALL. All of your users will match to it.

If you have no placement, or call Appodeal.show with a placement that does not exist or without placement in your segment, the impression will be tagged with 'default' placement and its settings will be applied

IMPORTANT: placements affect ONLY ad presentation, not loading or caching.

You can check more examples here

Advanced Features

Enabling test mode (test mode allows you to show our test ads with 100% fillrate)

Appodeal.setTestingEnabled(true)

Log level

Appodeal.setLogLevel(.verbose)
APDLogLevelOff Logs off
APDLogFlagError Only error messages
APDLogLevelWarning Warning and error messages
APDLogLevelDebug Debug messages
APDLogLevelInfo Erorr, warning and information messages
APDLogLevelVerbose All sdk messages

Banner smart size (allows banner to resize automatically to fit device screen)

Appodeal.setSmartBannersEnabled(true)

Banner background (creates a gray background view for banner ad)

Appodeal.setBannerBackgroundVisible(true)

Banner animation

Appodeal.setBannerAnimationEnabled(true)

Checking if ad is loaded

Appodeal.isReadyForShow(with: .interstitial)
Appodeal.isReadyForShow(with: .bannerTop)
Appodeal.isReadyForShow(with: .bannerBottom)
Appodeal.isReadyForShow(with: .rewardedVideo)

Caching ads with adType

Appodeal.cacheAd(.interstitial)
Appodeal.cacheAd(.banner)
Appodeal.cacheAd(.rewardedVideo)

Enabling or disabling automatic caching (should be used before SDK initialising)

Appodeal.setAutocache(true, types: .interstitial)
Appodeal.setAutocache(true, types: .banner)
Appodeal.setAutocache(true, types: .rewardedVideo)

Setting location tracking (should be used before SDK initialising)

 Appodeal.setLocationTracking(true)

Also add this in you info.plist

<key>NSLocationWhenInUseUsageDescription</key>
<string>Advertising</string>
<key>NSCalendarsUsageDescription</key>
<string>Advertising</string>

Setting User Data

Our SDK provides targeting for any included network. You can set user settings at any time by using the following class method:

Name of field Type Description
+(void)setUserId NSString user ID
+(void)setUserEmail NSString user email
+(void)setUserBirthday NSDate user birthday
+(void)setUserAge NSUInteger user age
+(void)setUserGender AppodealUserGender user gender
+(void)setUserOccupation AppodealUserOccupation user occupation
+(void)setUserRelationship AppodealUserRelationship user relationship
+(void)setUserAlcoholAttitude AppodealUserAlcoholAttitude user alcohol altitude
+(void)setUserSmokingAttitude AppodealUserSmokingAttitude user smoking altitude
+(void)setUserInterests NSString user interests
Appodeal.setUserId("userId")
Appodeal.setUserEmail("dt@email.net")
let currentDateTime = Date()
Appodeal.setUserBirthday(currentDateTime)
Appodeal.setUserAge(25)
Appodeal.setUserGender(.female)
Appodeal.setUserOccupation(.work)
Appodeal.setUserRelationship(.other)
Appodeal.setUserSmokingAttitude(.neutral)
Appodeal.setUserAlcoholAttitude(.neutral)
Appodeal.setUserInterests("other")

Versions of SDKs inside Appodeal framework

Ad network nameVersionBitcode support
AdColony3.0.6YES
AmazonAds2.2.15YES
AppLovin3.5.2YES
Avocarrot3.4.3NO
Chartboost6.6.1YES
FBAudienceNetwork4.18.0 YES
Flurry8.0.1 YES
Google Mobile Ads7.16.0 YES
InMobi6.1.2 YES
IronSource6.4.21 YES
StartApp3.4.2 YES
Tapjoy11.9.1 YES
UnityAds2.0.7 YES
Vungle4.0.9 YES
YandexMobileAds2.5.0 YES
myTarget4.6.2 YES
MoPub4.11.1 YES

Updating Your IDFA Settings

When you submit your application to the App you need to update its "Advertising Identifier (IDFA)" settings in order to comply with Apple advertising policy.

On the "Advertising Identifier" section:

  • Turn-on "Yes" on the right pane
  • Opt-in the "Serve advertisements within the app" checkbox
  • Opt-in the confirmation checkbox under "Limit Ad tracking setting in iOS"
Idfa

Changelog

2.0.0

  • Merge Static Intrestitial Ad and Skippable Video to one type - Interstital
  • Appodealx fully support
  • Native ad queue API
  • Update native media view
  • Update MRAID aligment for better UX
  • Added DFP support
  • Show styles as bitmask. Support operrand |
  • Improvements in VAST player
  • Update external network SDKs
  • Intelligent viewability detection
  • Intelligent fraud detection
  • Improve media files cacher
  • Fixes in segment/placement handling
  • Fixes in MRAID
  • Fixes in VAST
  • Improve banner refreshing cycle
  • Optimisation CPU/RAM work
  • Suppress AppLovin close button when app enter foreground
  • Fix VAST memory leak
  • Validate native ad assets
  • Avoid crashes in AmazonAds after user interaction

1.3.9

  • CocoaPods modular import YandexMobileAds, MoPub, AppLovin headers
  • FIX precache stat tracking for banners, interstitials, MRECs
  • FIX multiplying call +showStyle:rootViewController: for showStyles: AppodealShowStyleBannerBottom, AppodealShowStyleBannerTop

1.3.8

  • Performance improvement banner view precache logic.
  • FIX complain view memory leak
  • Deprecate API: APDBannerView loadAdWithPrecache

1.3.7

  • bug fixes for S2S callbacks implementation

1.3.6

  • bug fixes: Frequency capping
  • bug fixes: AdColony exception
  • Mopub rewarded video fix

1.3.5

  • bug fixes: Show with Placement for Rewarded video
  • small improvements

1.3.4

  • ATS Compliance Updates
  • bug fixes: Show with Placement when Autocache on

1.3.3

  • fixes statistics issues for OpenRTB
  • added disable network via segment settings
  • added auto refresh for APDBannerView
  • added RTB watch for video/rewarded video
  • added ability save click-links for direct offers and cross promo ads
  • bug fixes Pubnative with nil url request

1.3.1-1.3.2

  • stop SDK for iOS less than 8.0.0
  • added descriptions to .h files
  • added Appodeal setFramework for Plugin integration
  • added prefixes for VAST
  • correct bidrequest for Rewarded video for Open Rtb Integration
  • full support of Cocoapods
  • custom Cocoapods integration (Video, Native, Banner, Interstitial)

1.3.0

  • re-new Appodeal SDK - full framework with all adapters inside
  • uses WKWebView in MRAID
  • implementation new VAST adapter
  • fixes banner top&bottom aligning when use smart banners
  • ipv6 compatibility
  • supports hd sizes for banners and interstitials in cross-promo
  • support zeroidfa function for openrtb
  • support BCAT for openrtb
  • support Apps for kids option
  • updates adapters: Vungle 4.0.6, Chartboost 6.5.1, Facebook Audience 4.16.0, MyTarget 4.5.10

1.2.4

  • fixes banner size and view (320x50, 728x90)
  • disable banner background for default
  • add mute button and fullscreen mode for APDMediaView

1.2.3

  • fixes critical VAST error
  • added new method - Appodeal setBannerBackgroundVisible:YES

1.2.2

  • added Smaato native ad

1.2.0

  • improvements for ios 10 integrations
  • updates Cocoapods podspec - added all frameworks
  • support Swift for Cocoapods
  • added + (void)setUserId:(NSString *)userId;

1.1.1

  • performance improvement

1.1.0

  • iOS 10 support
  • added Tapjoy rewarded video adapter
  • added MyTarget video/rewarded video adapter
  • updated Google Admob
  • updated Autoclick detection for Open RTB
  • updated Pubnative integration for Native Ads
  • added new API for banners (enable/disable SmartBanners, Background, Animation
  • added Expandable banner ads

1.0.1

  • fix sending impressions for OpenRTB banners
  • fix APDVideoPlayer (VAST, MediaView) for iOS 8.4 and less
  • update RRI request

1.0.0

  • new API for ads calling (also support all old methods)
  • separete ads networks adapters from main framework
  • bitcode support
  • support OpenRtb integration for all types of ads
  • support multithread (depend on device&proccessor type)
  • support force revenue mode
  • support segments
  • full support Native video ads
  • use AVPlayer instead MPMoviePlayer in VAST implementaton
  • new log levels for quality debuging: Error, Warning, Info, Debug, Verbose (remove old Debug mode)
  • new callback for banner - (void)bannerDidRefresh
  • callbacks return errors and object, that receive error
  • new callback for all types of video - DidBecomeUnavailable, didFailToPresentWithError
  • add internal monitoring of exceptions
  • adwatch option - monitor for showed ads
  • remove singleton for all ads types
  • improve of viewability control option

0.10.7

  • Pubnative S2S integration for Native ads

0.10.6

  • update Direct offers for Native ads
  • fixes error in video-offers on iOS 7.x

0.10.4

  • Yandex Metrica and Yandex ADS updstes only

0.10.3

  • fixed error with Mopub banners

0.10.2

  • small bug fixes

0.10.1

  • Fixes RRI first request bug
  • Implements full MRAID features
  • autoclick protection

0.10.0

  • updated anti-froud protection
  • fixes Yandex Rewarded video error
  • update Facebook Audience Network
  • adds MoPub Video Native ads
  • added ability to control autoplay of Video Native ads

0.9.2

  • Native ads mediation improvement

0.9.0

  • Native video ads (Applovin, Facebook, Pubnative, Adcolony, MoPub)
  • added Smaato native ads
  • added Test native ads
  • added Native ads Direcrt offers
  • added AppodealNativeMediaView
  • added AppodealAdChoicesView
  • improvement of Video caching
  • updated SDKs (Facebook Audience, StartApp, Pubnative, Inmobi)
  • updated VAST | VPAID video integration
  • SpotX VPAID integration
  • added Yandex Video
  • fixed backgrounds crashes

0.8.1

  • added MREC (300*250 banners) - Admob, Inmobi, Inneractive, Yandex, MoPub, liveRails
  • native ads callbacks (nativeAdDidClick, nativeAdDidPresent)
  • imrovement of VAST Video integration
  • added OpenX Interstitials and Banners (320*50)
  • small bug fixes in Banners and Native ads
  • imrovement Native Ads template
  • added MoPub Rewarded video

0.8.0

  • added MREC (300*250 banners) - Admob, Amazon ,Inmobi, Inneractive, Yandex
  • native ads callbacks (nativeAdDidClick, nativeAdDidPresent)
  • imrovement of VAST Video integration
  • added OpenX Interstitials
  • small bug fixes in Banners and Native ads

0.7.0

  • improvment of Rewarded video
  • show ads with price floor
  • test mode in SDK
  • Millennial Media (banners, interstitials, video)
  • update MoPub SDK
  • update Yandex ads SDK (error fixes)
  • update LiveRails SDK
  • update SpotX SDK

0.6.2

  • small bug fixes
  • updates MoPub Native ads implementation
  • adds VAST Direct video campaign
  • Fixes Banner zero size warning

0.6.1

  • fixes some warnings
  • update AppodealBannerView class
  • fixs crashes in iPad banners in sandbox mode

0.6.0

  • separate ad type AppodealShowStyleRewardedVideo for rewarded videos
  • StartApp video (Rewarded) addon
  • Inmobi video (rewarded) addon
  • SpotX video (skippable) addon
  • Liverail video (rewarded) addon
  • fix of Applovin crashes with user setting
  • Native ads manager (load up to 10 native ads)
  • image in native ads (StartApp, Pubnative)
  • Flurry native ads integration update
  • error fix with Pubnative clicks
  • contentRating for native ads
  • Inner-active (banners and interstitials) addon
  • Rubicon (banners and interstitials) update
  • Liverail (banner, interstitials) addon
  • Amazon ads integration (adds click) improvement
  • AppodealBannerView class with banners size
  • added a banner 300*250 (beta)
  • added a banner size (320*50, 728*90, 300*250)
  • network requests optimization
  • external SDKs update
  • user setting before initialized SDK addon
  • removed OpenX banners

0.5.4

  • Remove Adcolony rewarded popup
  • iOS 9.1 support

0.5.3

  • Critical bug fixes
  • Recommended for all user
  • fix MRAID banned error

0.5.2

  • Banner auto refresh interval is now configurable from dashboard
  • Bug fixes

0.5.1

  • Updates Inmobi SDK
  • Updates Inmobi Video, Interstitials, Banners, Native ads adapters
  • Adds Flurry Native ads
  • Fixes crash AdMob smart-banners
  • Fixes Rubicon Interstitial adapter
  • Adds asynchronous download of images in templates for native ads
  • Fixes crash of templates of native ads

0.5.0 Golden Master iOS SDK

  • Native ads support (Target mail.ru, Facebook, Inmobi, StartApp, Applovin, MoPub, Avocarrot, Pubnative, Flurry)
  • Native ads templates
  • updates StartApp SDK integration
  • resolves nonRewarded Adcolony video error
  • updates Inmobi SDK integration

0.4.9

  • Only XCODE 7 support
  • Yandex ads banners
  • Yandex ads interstitials
  • fix Cocoalumberjack integration problems
  • improvement Interstitials and video mediation
  • banner autocache (disable by default)

3rd party SDK updatest for iOS 9

0.4.8

  • Last version which compatible XCODE 6.x
  • Fix video delegate
  • Check version of SDK in API
  • Target mail.ru iPad banner- center position

0.4.7.1

  • Update Target mail.ru sdk for banners

0.4.7

  • Fix MoPub video error
  • Add Rubicon banners
  • Add Rubicon interstitials
  • Add OpenX banners
  • Stop SDK public method
  • Https support (for iOS 9)

0.4.6

  • Critical bug fixes
  • Renew skippable/nonskippable video option
  • Add Chartboost video

0.4.5

  • Fix MoPub`s error click statistics (interstitials)
  • Facebook Audience Network added (banners)
  • New Public method - disableLocationPermissionCheck
  • Add new network - StartApp (banners and interstitials)

0.4.4

  • Prepare SDK for external integration (Unity plugin is ready too)
  • Inmobi banners and interstitials support
  • Removing Applovin banners
  • StartApp banners and interstitials support (for internal testing apps only)
  • Yandex banners and interstitials support (for internal testing apps only)

0.4.3

  • Facebook Audience Network added (Interstitials)
  • Smaato added (Banner and Interstitials)
  • Fix Amazon banner view
  • Public methods added
  • Fixes MRAID clicks handling

0.4.1

  • new adnetwork implementation - Target Mail.ru (Banners, Interstitials), Adcolony & Vungle (Video), Inmobi (Banner & Interstitials)
  • improvement Banner integration
  • support iPAD (vertical orientation)
  • skip/non skip video
  • preroll video
  • apps for kids support

0.3.6

  • fixed video/sound playback
  • fixed 'applicationWillEnterForeground' for banners
  • fixed hide banner
  • fixed bugs

0.3.5

  • adds AppLovin videos
  • adds Swift module map (obsoletes bridge header)
  • fixes ads logic
  • fixes bugs

0.3.4

  • fixed smaato banners
  • fixed banenrs logic
  • fixed bugs

0.3.3

  • updated admob
  • fixed mraid banners/interstitials
  • fixed bugs

0.3.2

  • added new api
  • fixed mraid banners/interstitials
  • fixed fixed banners
  • fixed bugs

0.3.1

  • added new api
  • fixed fixed banners
  • fixed bugs

0.3.0

  • added new api
  • added method showWithAdNetworkName
  • fixed fixed video ads
  • fixed optional callbacks

0.2.9

  • fixed cacheBanner timeout
  • fixed disable admob precache
  • fixed Interstitial networks

0.2.8

  • Fixed banners loading

0.2.7

  • Fixed MoPub video

0.2.6

  • Fixed video ads
  • Fixes bugs

0.2.5

  • fixed banners fillrate

0.2.4

  • Added Chartboost video
  • Added MoPub video
  • Fixes bugs

0.2.3

  • Fixed banner sizes for large screens
  • Fixes bugs

0.2.2

  • Added new sdk api
  • Fixes bugs

0.2.1

  • Added AerServ
  • Added CocoaPods support
  • Added new sdk api
  • Fixes bugs

0.2.0

  • Added AdColony
  • Added Vungle
  • Added new sdk api
  • Fixes bugs

0.1.9

  • Fixes mraid banner sizes.
  • Fixes device rotation craches.

0.1.8

  • Fixes banner position when device orientation changed
  • Fixes craches.

0.1.7

  • Fixes reward user callback

0.1.6

  • Added AODAdView