SDK Integration | Appodeal Intelligent Ad Mediation

Link your Admob account

Appodeal yields optimal results in cooperation with Admob. To continue, you need to link your Admob account.

If you don't have Admob account, please sign up on Admob.com.

To link your Admob account to Appodeal, use the Chrome extension:

INSTALL EXTENSION


The extension source code is available at https://github.com/appodeal/admob-configurator.

The extension will make two changes in your Admob account. First, it will allow Appodeal to access your Admob reports over API, and second, it will create new ad units on Admob and submit them to Appodeal.

VIDEO TUTORIAL

Download SDK

Current Appodeal SDK framework version 1.3.4

The Appodeal SDK is distributed as static library. Download it from the here and unzip it. Current version of Appodeal SDK is 1.3.4.

You can read changelog of current version here

Preparing Your Apps for iOS9-iOS10

To avoid a major drop in revenue publishers should turn off App Transport Security until further notice.

To ensure monetization with some adnetworks in Appodeal is not impacted, publishers should add the following to their plist file to allow any insecure connection:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

Developers can also edit the plist by adding NSAppTransportSecurity key of dictionary type with a dictionary element of NSAllowsArbitraryLoads of boolean type set to "Yes".

Dictionary key

Add this key in Info.plist , if you use this function in your app

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

Bitcode Setting in Xcode 7+

Bitcode

Requirements

Xcode 7.0 or higher

Deployment target of 8.0 or higher

Install CocoaPods to simplify dependency management

Adding the SDK to your Xcode project

Run with new Appodeal framework

1. Download SDK

1.1. Download the latest FAT IOS SDK version and extract 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

Run with CocoaPods

1. To download and incorporate 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', '~> 1.1'
end

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

sudo gem install cocoapods

If you have problems with versions of pods please run

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

3. You can add custom Pods with type

Interstitial

platform :ios, '8.0'   

target 'Name' do
pod 'Appodeal/Interstitial', '1.3.3'
end

Banner and MREC

platform :ios, '8.0'

target 'Name' do
pod 'Appodeal/Banner', '1.3.3'
end

Skippable video and Rewarded video

platform :ios, '8.0'

target 'Name' do
pod 'Appodeal/Video', '1.3.3'
end

Native Ads

platform :ios, '8.0' 

target 'Name' do
pod 'Appodeal/Native', '1.3.3'
end

Change AppKey and Bundle ID (if you want to test your app)

68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6170706f6465616c2d696d616765732f53637265656e2b53686f742b323031352d30382d31382b61742b31332e35362e30312e706e67
68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6170706f6465616c2d696d616765732f53637265656e2b53686f742b323031352d30382d31382b61742b31332e35362e31302e706e67

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
  • CoreFoundation
  • CoreGraphics
  • CoreImage
  • CoreLocation
  • CoreMedia
  • CoreMotion
  • CoreTelephony
  • EventKit
  • EventKitUI
  • libc++
  • libsqlite3.dylib
  • libxml2.2.dylib
  • libz.dylib
  • MediaPlayer
  • MessageUI
  • MobileCoreServices
  • QuartzCore
  • Security
  • Social
  • StoreKit
  • SystemConfiguration
  • Twitter
  • UIKit
  • WebKit
  • JavaScriptCore
  • CoreBluetooth
  • GLKit
  • SafariServices

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

Ios xcode linker

Run

SDK initialization

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

  • [Appodeal initializeWithApiKey:@"APPODEAL_APP_KEY" types:(AppodealAdType)types]

in didFinishLaunchingWithOptions method

types parameter set Ad types (ex. AppodealAdTypeRewardedVideo, AppodealAdTypeNonSkippableVideo, AppodealAdTypeSkippableVideo). Ad types can be combined using "|" operator. For example AppodealAdTypeRewardedVideo | AppodealAdTypeVideo.

#import "AppDelegate.h"
#import <Appodeal/Appodeal.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
  // Appodeal SDK Initialization
  [Appodeal initializeWithApiKey:@"APPODEAL_APP_KEY" types: (AppodealAdType)(AppodealAdTypeInterstitial)];
  return YES;
}

@end

Import <Appodeal/Appodeal.h> in AppDelegate.m and start sdk initialization

#import "AppDelegate.h"
#import 

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  // Appodeal SDK Initialization
    [Appodeal initializeWithApiKey:@"fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f" types: (AppodealAdType)(AppodealAdTypeInterstitial | AppodealAdTypeSkippableVideo | AppodealAdTypeBanner | AppodealAdTypeMREC | AppodeaelAdTypeNative | AppodealAdTypeRewardedVideo)];
  return YES;
}

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 "YourViewController.h"
#import <Appodeal/Appodeal.h>

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show full screen banner
  [Appodeal showAd:AppodealShowStyleInterstitial rootViewController:self];
}

Delegate callbacks (optional)

import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@interface YourViewController () <AppodealInterstitialDelegate>

@end

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // set delegate
  [Appodeal setInterstitialDelegate:self];
}

- (void)interstitialDidLoadAdisPrecache:(BOOL)precache {
  NSLog(@"interstitial did load");
}

- (void)interstitialDidFailToLoadAd {
  NSLog(@"interstitial failed to load");
}

- (void)interstitialWillPresent {
  NSLog(@"interstitial will be shown");
}

- (void)interstitialDidClick {
  NSLog(@"interstitial has been clicked");
}

- (void)interstitialDidDismiss {
  NSLog(@"interstitial has been closed or dismissed");
}

Display interstitial

[Appodeal showAd:AppodealShowStyleInterstitial rootViewController:self];

Checking if interstitial is loaded

[Appodeal isReadyForShowWithStyle: AppodealShowStyleInterstitial];

Banner Integration

Basic integration

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@implementation YourViewController

@interface YourViewController ()

@end

- (void)viewDidLoad
{
  [super viewDidLoad];

  // init ad banner
  [Appodeal showAd:AppodealShowStyleBannerBottom rootViewController:self];
}

Banner Delegate

AppodealBannerDelegate 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 implement AppodealBannerDelegate protocol.

@protocol AppodealBannerDelegate <NSObject>

@optional

- (void)bannerDidLoadAdIsPrecache:(BOOL)precache;
- (void)bannerDidLoadAd __attribute__((deprecated("Use -bannerDidLoadAdisPrecache:precache: instead")));
- (void)bannerDidRefresh;
- (void)bannerDidFailToLoadAd;
- (void)bannerDidClick;
- (void)bannerDidShow;

@end

These methods may be implemented in either a separate object like a view controller:

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@interface YourViewController () <AppodealBannerDelegate>

@end

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

For example:

// pin ad banner at Bottom of the screen
[Appodeal showAd:AppodealShowStyleBannerBottom rootViewController:self];

AppodealShowStyleBannerTop - pins ad banner at top

For example:

// pin ad banner at Top of the screen
[Appodeal showAd:AppodealShowStyleBannerTop rootViewController:self];

You can also adds Appodeal banner to your view hierarchy manually.

For example:

- (void)viewWillAppear:(BOOL)animated
{
  [super viewWillAppear:animated];

  [self.view addSubview:[Appodeal banner]];
  [Appodeal banner].frame = CGRectMake(0, 0, self.view.bounds.size.width, APPODEAL_BANNER_HEIGHT);
}

To remove banner from your view hierarchy:

[Appodeal hideBanner];

Checking if banner is loaded

[Appodeal isReadyForShowWithStyle: AppodealShowStyleBannerBottom]
[Appodeal isReadyForShowWithStyle: AppodealShowStyleBannerTop];

Advanced Banner View Integration

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

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@interface YourViewController () <AppodealBannerViewDelegate>
@end

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // required: init ad banner
  AppodealBannerView *bannerView = [[AppodealBannerView alloc] initWithSize:kAppodealUnitSize_320x50 rootViewController:self];

  // optional: set delegate
  bannerView.delegate = 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
- (void)bannerViewDidLoadAd:(APDBannerView *)bannerView {
  NSLog(@"Banner %@ did load!", bannerView);
}

- (void)bannerViewDidInteract:(APDBannerView *)bannerView {
  NSLog(@"Banner %@ did interact", bannerView);
}

- (void)bannerView:(APDBannerView *)bannerView didFailToLoadAdWithError:(NSError *)error {
  NSLog(@"Banner %@ did fail with error: %@", bannerView, error);
}

- (void)bannerViewDidRefresh:(APDBannerView *)bannerView {
   NSLog(@"Banner %@ did refresh ", bannerView);
}

@end

MREC View Integration

Class "AppodealMRECView" is subclass of "AppodealBannerView". Instance of this class has size 300x250.

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>
​
interface YourViewController () <AppodealBannerViewDelegate>
@end
​
@implementation YourViewController
​
- (void)viewDidLoad {
  [super viewDidLoad];
  ​
  // required: init ad banner
  AppodealMRECView *mrecView= [[AppodealMRECView alloc] initWithRootViewController:self];
  ​
  // optional: set delegate
  mrecView.delegate = self;
  ​
  // required: add banner to superview and call loadAd to start banner loading
  [self.view addSubview:mrecView];
  [mrecView loadAd];
}
​
// optional: implement any of AppodealBannerViewDelegate methods
- (void)bannerViewDidLoadAd:(APDBannerView *)bannerView {
  NSLog(@"Banner %@ did load!", bannerView);
}

- (void)bannerViewDidInteract:(APDBannerView *)bannerView {
  NSLog(@"Banner %@ did interact", bannerView);
}

- (void)bannerView:(APDBannerView *)bannerView didFailToLoadAdWithError:(NSError *)error {
  NSLog(@"Banner %@ did fail with error: %@", bannerView, error);
}

- (void)bannerViewDidRefresh:(APDBannerView *)bannerView {
   NSLog(@"Banner %@ did refresh ", bannerView);
}
​
@end

Rewarded (Non-skippable) Video Integration

Recommended video type for maximum revenue.

Basic integration

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show video
  [Appodeal showAd:AppodealShowStyleRewardedVideo rootViewController:self];
}

Rewarded (Non-skippable) Video Delegate Protocol

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 an video ad did complete with reward (amount and name can be configured via Appodeal Dashboard). To handle this events you need implement any of optional methods of AppodealRewardedVideoDelegate protocol.

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@interface YourViewController () <AppodealRewardedVideoDelegate>

@end

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // set delegate
  [Appodeal setRewardedVideoDelegate:self];
}

- (void)rewardedVideoDidLoadAd {
  NSLog(@"video ad did load");
}

- (void)rewardedVideoDidFailToLoadAd {
  NSLog(@"video ad failed to load");
}

- (void)rewardedVideoDidPresent {
  NSLog(@"video ad did present");
}

- (void)rewardedVideoWillDismiss {
  NSLog(@"video ad has been closed or dismissed");
}

- (void)rewardedVideoDidFinish:(NSUInteger)rewardAmount name:(NSString *)rewardName {
  NSLog(@"video ad has been finished and user should be rewarded with %@ %@", @(rewardAmount), rewardName);
}

Display Rewarded (Non-skippable) Video

[Appodeal showAd:AppodealShowStyleRewardedVideo rootViewController:self];

Checking if rewarded video is loaded

[Appodeal isReadyForShowWithStyle: AppodealShowStyleRewardedVideo];

Skippable Video Integration

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

Basic integration

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show video
  [Appodeal showAd:AppodealShowStyleSkippableVideo rootViewController:self];
}

Skippable Video Delegate Protocol

AppodealSkippableVideoDelegate 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 did complete. To handle this events you need implement any of optional methods of AppodealSkippableVideoDelegate protocol.

#import "YourViewController.h"
#import <Appodeal/Appodeal.h>

@interface YourViewController () <AppodealSkippableVideoDelegate>

@end

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // set delegate
  [Appodeal setVideoDelegate:self];
}

- (void)skippableVideoDidLoadAd {
  NSLog(@"video ad did load");
}

- (void)skippableVideoDidFailToLoadAd {
  NSLog(@"video ad failed to load");
}

- (void)skippableVideoDidPresent {
  NSLog(@"video ad did present");
  }

- (void)skippableVideoWillDismiss {
  NSLog(@"video ad has been closed or dismissed");
}

- (void)skippableVideoDidFinish {
  NSLog(@"video ad has been finished and user should be rewarded");
}

Display skippable video

[Appodeal showAd:AppodealShowStyleSkippableVideo rootViewController:self];

Checking if skippable video is loaded

[Appodeal isReadyForShowWithStyle: AppodealShowStyleSkippableVideo];

Integration NativeAds

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 "APDNativeAdLoader.h"
@interface YourViewController : UIViewController
@property (nonatomic, strong) APDNativeAdLoader* adLoader; // should insert

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];
}

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 to the header file

@interface YourViewController : UIViewController <APDNativeAdLoaderDelegate>
@property (nonatomic, strong) APDNativeAdLoader* _adLoader; // should insert

After your initialize appodeal native ad object set delegate:

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

Impliment the following functions:

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAd:(APDNativeAd *)nativeAd;
- (void)nativeAdLoader:(APDNativeAdLoader *)loader didFailToLoadWithError:(NSError *)error;

Method nativeAdLoader:DidLoad return instance of native ad. You also call loadAd several times to get more native ad.

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAd:(APDNativeAd *)nativeAd{
  [self.adService loadAdWithType:APDNativeAdTypeAuto];
  APDNativeAd * nativeAd = nativeAd;
  //Do you staff here
}

Using media view

APDNativeAd provides video ads. You can show it with APDMediaView. That object created with native ad and rootViewController. Instance of APDMediaView show 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 custom muted button on media view and enabled/disabled sound playable video. When video completed media view show image. If you use APDMediaView as main Image, you can set type media view

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAd:(APDNativeAd *)nativeAd{
  APDMediaView* mediaView = [APDMediaView alloc] initWithFrame:YOUR_NEEDED_FRAME;
  [mediaView setNativeAd:nativeAd rootViewController:self];
  [self.view addSubview: mediaView];
}

You can set mute while playing video, for example you can unmute ad in fullscreen by usage

(void)mediaView:(APDMediaView *)mediaView didPresentFullScreenView:(UIView *)presentedView;
- (void)mediaView:(APDMediaView *)mediaView didPresentFullScreenView:(UIView *)presentedView {
  mediaView.muted = NO;
}

Using media view callbacks

@interface YourViewController () <APDMediaViewDelegate>

@end

@implementation YourViewController

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAds:(NSArray <__kindof APDNativeAd *> *)nativeAds{
  APDMediaView* mediaView = [APDMediaView alloc] initWithFrame:YOUR_NEEDED_FRAME;
  [mediaView setNativeAd:nativeAd rootViewController:self];
  mediaView.delegate = self;
  [self.view addSubview: mediaView];
}


#pragma mark - APDMediaViewDelegate

- (void)mediaViewStartPlaying:(APDMediaView *)mediaView {

}

- (void)mediaViewFinishPlaying:(APDMediaView *)mediaView videoWasSkipped:(BOOL)wasSkipped {
  
}

- (void)mediaView:(APDMediaView *)mediaView didPresentFullScreenView:(UIView *)presentedView {
  
}

- (void)mediaViewDidDismissFullScreen:(APDMediaView *)mediaView {
  
}

Appodeal Ad Choices View

Most of ads networks require to use daa privacy view in native ad. APDNativeAd return instance of UIView that is ad choices view. This view mustn't overlap any assets or be overlapped by any assets. Size of this icon should be 24x24 or more. If this element not requier by networks ad choices view return nil.

@interface YourViewController () <APDNativeAdLoaderDelegate>

@end

@implementation YourViewController

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAds:(NSArray <__kindof APDNativeAd *> *)nativeAds{
  [self.adService loadAdWithType:APDNativeAdTypeAuto];
  APDNativeAd * nativeAd = [nativeAds firstObject];
  if (nativeAd.adChoicesView) {
    [self.view addSubview:native.adChoicesView];
  }
}

Appodeal native ad structure

Appodeal native ads contain the next fields:

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 contains image size and url image, unrequired field
APDImage *iconImage contains icon size and url, required field icon
UIView *adChoicesView contains adChoicesView view

Using a custom view for native ad

Before the show native ads you should call attachToView method.

[_ad attachToView: customView viewController:self];

And implement detachFromView method :

[_ad detachFromView];

S2S Rewards Callbacks

To secure you apps economy we offer S2S reward callbacks. To validate each reward you need to setup 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 hey in the app settings in your dashboard

3. Reward callback will be send 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 transactinos

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

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 it's 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 - match users in one or multiple of your apps
  • SDK version - match users that only use specified sdk version or range of versions
  • Device type - match users that using tablet and/or phone
  • App version - match users that only use specified app version or range of versions
  • Country - match users only from specified countries
  • OS version - match users that are using devices with specified Android
  • Has app installed - only match users that have specified apps installed
  • Session count - match users that had specified number of sessions in your app
  • Average session length - match users with specified that spent specified average session length in your app
  • Device model - match user on specified devices
  • Connection type - match 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 inapps 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 [[APDSdk sharedSdk] setCustomRule: customRule] method, i.e. [[APDSdk sharedSdk] 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 settins. 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 ant ad type it supports
  • Min pricefloor. Allows you to set minimum price floor for each ad type. Ads with eCPM lower then 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.

Placement

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

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

[Appodeal showAd:AppodealAdTypeInterstitial forPlacement:@"PLACEMENT" rootViewController:UIViewController];

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.SKIPPABLE_VIDEO you can disable interstitials or skippable 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 impression period (in seconds) for interstitials, skippable and rewarded video shown with the placement. If the period between two impression is less than impression period second impression will not be shown and 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 then price floor will not be shown and Appodeal.show method will return false.

Placements can only be used as part of 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 placement that do not exist or without placement in your segment the impression will be tagged with 'default' placement and it's settings will be applied

You can check more examples here

Advanced features

Enabling test mode

[Appodeal setTestingEnabled: YES]

Log level

You can set log level for appodeal

[[APDSdk sharedSdk] setLogLevel:APDLogLevelDebug];
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

You can set true, that enabled smart sizing

[Appodeal setSmartBannersEnabled:YES]

Banner background

[Appodeal.setBannerBackgroundVisible: YES]

Banner animation

[Appodeal.setBannerAnimationEnabled:YES]

Checking if ad is loaded

To check if interstitial is loaded use:

[Appodeal isReadyForShowWithStyle: AppodealShowStyleInterstitial];

To check if skippable video is loaded use:

[Appodeal isReadyForShowWithStyle: AppodealShowStyleSkippableVideo];

To check if video or interstitial is loaded use:

[Appodeal isReadyForShowWithStyle: AppodealShowStyleVideoOrInterstitial];

To check if banner is loaded use:

[Appodeal isReadyForShowWithStyle: AppodealShowStyleBannerTop];
//or
[Appodeal isReadyForShowWithStyle: AppodealShowStyleBannerBottom];

To check if rewarded video is loaded use:

[Appodeal isReadyForShowWithStyle: AppodealShowStyleRewardedVideo];
//or
[Appodeal isReadyForShowWithStyle: AppodealShowStyleNonSkippableVideo];

Caching ads with adType

If you need cached Interstitial use:

[Appodeal cacheAd:AppodealAdTypeInterstitial];

If you need cached skippable video use:

[Appodeal cacheAd:AppodealAdTypeSkippableVideo];

If you need cached rewarded video use:

[Appodeal cacheAd:AppodealAdTypeRewardedVideo];

If you need cached non skippable video use:

[Appodeal cacheAd:AppodealAdTypeNonSkippableVideo];

Enabling or disabling automatic caching

[Appodeal setAutocache: NO types:AppodealAdTypeInterstitial];

Should be used before SDK initialization

To disable automatic caching for interstitials use, as default it's enabled:

[Appodeal setAutocache: NO types:AppodealAdTypeInterstitial];

To disable automatic caching for skippable videos use, as default it's enabled:

[Appodeal setAutocache: NO types:AppodealAdTypeSkippableVideo];

To disable automatic caching for rewarded videos use, as default it's enabled:

[Appodeal setAutocache: NO types:AppodealAdTypeRewardedVideo];

To disable automatic caching for banners use, as default it's enabled:

[Appodeal setAutocache: NO types:AppodealAdTypeBanner];

Disabling networks

Remove adapters from Project

Disabling networks for ad types

Should be used before SDK initialization

Disabling specified network for specified adTypes. Example:

[Appodeal disableNetworkForAdType:AppodealAdTypeInterstitial name:@"NETWORK_NAME"];
[Appodeal disableNetworkForAdType:AppodealAdTypeSkippableVideo name:@"NETWORK_NAME"];
[Appodeal disableNetworkForAdType:AppodealAdTypeRewardedVideo name:@"NETWORK_NAME"];
[Appodeal disableNetworkForAdType:AppodealAdTypeBanner name:@"NETWORK_NAME"];
[Appodeal disableNetworkForAdType:AppodealAdTypeMREC name:@"NETWORK_NAME"];
[Appodeal disableNetworkForAdType:AppodealAdTypeNativeAd name:@"NETWORK_NAME"];

Disabling location permission check

//[Appodeal disableLocationPermissionCheck]; // this method deprecated use setLocationTracking:
[Appodeal setLocationTracking:YES];

Should be used before SDK initialization

Setting user data.

Our sdk provides targeting for any included network. You can set user settings on any time by use following class method:

+(void)setUserId NSString user ID
+(void)setUserEmail NSString user email
+(void)setUserBirthday NSDate user birthday
+(void)setUserAge NSUInteger user age
+(void)setUserGender AppodealUserGender user geneder
+(void)setUserOccupation AppodealUserOccupation user ocupation
+(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"];
[Appodeal setUserBirthday:[NSDate date]];
[Appodeal setUserAge:25];
[Appodeal setUserGender:AppodealUserGenderMale];
[Appodeal setUserOccupation:AppodealUserOccupationWork];
[Appodeal setUserRelationship:AppodealUserRelationshipOther];
[Appodeal setUserSmokingAttitude:AppodealUserSmokingAttitudeNeutral];
[Appodeal setUserAlcoholAttitude:AppodealUserAlcoholAttitudeNeutral];
[Appodeal setUserInterests:@"other"];

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

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