SDK Integration | Appodeal

App key

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

Appodeal iOS SDK 2.0 documentation

Download SDK

1.1 You can download a release version of Appodeal SDK here

1.2 Download a demo project for the release version you can here

iOS (objective C) 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>

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>

Download SDK

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

SDK Initialization

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

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

in didFinishLaunchingWithOptions method.

Types parameter is responsible for Ad types (ex. AppodealAdTypeRewardedVideo, AppodealAdTypeInterstitial). Ad types can be combined using "|" operator. For example AppodealAdTypeRewardedVideo | AppodealAdTypeInterstitial.

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:AppodealShowStyleInterstitial rootViewController:self];

To display interstitial: use [Appodeal showAd:AppodealShowStyleInterstitial rootViewController:self];

To display rewarded video: use [Appodeal showAd:AppodealShowStyleRewardedVIdeo rootViewController:self];

To display non-skippable video: use [Appodeal showAd:AppodealShowStyleNonskippableVideo rootViewController:self];

To display banner at the bottom of the screen: use [Appodeal showAd:AppodealShowStyleBannerBottom rootViewController:self];

To display banner at the top of the screen: use [Appodeal showAd:AppodealShowStyleBannerTop rootViewController:self];

You can also call displaying ad with different show styles at the same time and the ad with the highest eCPM will be shown.

Example: [Appodeal showAd: (AppodealShowStyleInterstitial | AppodealShowStyleNonSkippableVideo)];

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)interstitialDidFailToPresent{
NSLog(@"interstitial failed to present");
}

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

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

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

- (void)interstitialDidFinish{
  NSLog(@"interstitial finished");
}

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

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

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

[Appodeal setInterstitialDelegate:self];

Display interstitial

[Appodeal showAd:AppodealShowStyleInterstitial rootViewController:self];

Interstitial callbacks

- (void)interstitialDidLoadAdisPrecache:(BOOL)precache; //interstitial was loaded (precache flag shows if the loaded ad is precache)
- (void)interstitialDidFailToLoadAd; //interstitial failed to load
- (void)interstitialDidFailToPresent; /interstitial was loaded but failed to present (may be caused by inner ad network error, placement settings or invalid creative)
- (void)interstitialWillPresent; //interstitial was loaded and will present
- (void)interstitialDidFinish; //interstitial did finish (in case it was video)
- (void)interstitialDidDismiss; //interstitial was closed
- (void)interstitialDidClick; //interstitial was clicked (optional, can be not called with video ad)

Non skippable video integration

Basic integration

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

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show video
  [Appodeal showAd:AppodealShowStyleNonSkippableVideo 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 this events you need to implement any of the optional methods of AppodealNonSkippableVideoDelegate protocol.

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

@interface YourViewController () <AppodealNonSkippableVideoDelegate>

@end

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

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

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

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

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

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

- (void)nonSkippableVideoDidFinish {
  NSLog(@"video ad has been finished");
}

- (void)nonSkippableVideoDidFailToPresent {
  NSLog(@"video ad did fail to present");
}

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

[Appodeal setNonSkippableVideoCallbacks:self];

Display Non skippable Video

[Appodeal showAd:AppodealShowStyleNonSkippableVideo rootViewController:self];

Non skippable video callbacks

- (void)nonSkippableVideoDidLoadAd; //non skippable video was loaded
- (void)nonSkippableVideoDidFailToLoadAd; //non skippable video failed to load
- (void)nonSkippableVideoDidPresent; //non skippable video was presented
- (void)nonSkippableVideoDidFailToPresent; //non skippable video was loaded but failed to present (may be caused by inner error in ad networks, placement settings or invalid creative)
- (void)nonSkippableVideoWillDismiss; //non skippable video was closed
- (void)nonSkippableVideoDidFinish; //non skippable video was fully watched
- (void)nonSkippableVideoDidClick; //non skippable video was clicked (optional)

Rewarded video integration

Basic integration

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

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show video
  [Appodeal showAd:AppodealShowStyleRewardedVideo 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 an video ad was completed with reward (amount and name can be configured via Appodeal Dashboard). To handle this events you need to implement any of the 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);
}

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

[Appodeal setRewardedVideoCallbacks:self];

Display Rewarded Video

[Appodeal showAd:AppodealShowStyleRewardedVideo rootViewController:self];

Rewarded video callbacks

- (void)rewardedVideoDidLoadAd; // rewarded video ad was loaded
- (void)rewardedVideoDidFailToLoadAd; //rewarded video ad failed to load
- (void)rewardedVideoDidFailToPresent; //rewarded video ad was loaded but failed to present due to ad netwotk error, placement settings or invalid creative
- (void)rewardedVideoDidPresent; //rewarded video was presented
- (void)rewardedVideoWillDismiss; //rewarded video was closed
- (void)rewardedVideoDidFinish:(NSUInteger)rewardAmount name:(NSString *)rewardName; //rewarded video finished with some reward

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

@implementation YourViewController

@interface YourViewController ()

@end

- (void)viewDidLoad
{
  [super viewDidLoad];

  // show banner at the bottom of the screen
  [Appodeal showAd:AppodealShowStyleBannerBottom 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.

@protocol AppodealBannerDelegate <NSObject>

@optional

- (void)bannerDidLoadAdIsPrecache:(BOOL)precache; //banner was loaded (precache flag shows if the loaded ad is precache)
- (void)bannerDidRefresh; //banner was refreshed
- (void)bannerDidFailToLoadAd; //banner failed to load the ad
- (void)bannerDidClick; //banner was clicked
- (void)bannerDidShow; //banner was shown

@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

@implementation YourViewController

- (void)viewDidLoad
{
  [super viewDidLoad];
 
  //set delegate
  [Appodeal setBannerDelegate:self];
}

- (void)bannerDidLoadAdIsPrecache:(BOOL)precache {
         NSLog(@"banner was loaded");
}
- (void)bannerDidRefresh{
         NSLog(@"banner was refreshed");
}
- (void)bannerDidFailToLoadAd{
         NSLog(@"banner failed to load the ad");
}
- (void)bannerDidClick{
         NSLog(@"banner was clicked");
}
- (void)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 bottom of the screen

For example:

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

// 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, 50);
}

To remove banner from your view hierarchy:

[Appodeal hideBanner];

Advanced Banner View Integration

If basic integration is not appropriate due to 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 application (to move it from one view controller to another)

#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 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

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

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 shoucl attach it to contentView of current cell where 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 to the header file

@interface YourViewController : UIViewController <APDNativeAdLoaderDelegate>

Implement the following functions:

- (void)nativeAdLoader:(APDNativeAdLoader *)loader didLoadNativeAds:(NSArray <__kindof APDNativeAd *> *)nativeAds;
- (void)nativeAdLoader:(APDNativeAdLoader *)loader didFailToLoadWithError:(NSError *)error;

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

@interface YourViewController : UIViewController <APDNativeAdPresentationDelegate>

Implement the following functions:

- (void)nativeAdWillLogImpression:(APDNativeAd *)nativeAd; //native ad was shown
- (void)nativeAdWillLogUserInteraction:(APDNativeAd *)nativeAd; //native ad was clicked

Native complain button

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

// use before method [attachToView: viewController:]
[self.nativeAd complainButtonPositon:APDComplainBottom];
[self.nativeAd attachToView:self.contentView viewController:controller];

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 "APDNativeAdQueue.h"
@interface YourViewController : UIViewController
@property (nonatomic, strong) APDNativeAdQueue* nativeAdQueue;

You can initialize nativeAdQueue with custom native count and type

- (void)viewDidLoad{
  nativeAdQueue = [APDNativeAdQueue new];
  [nativeAdQueue setMaxAdSize:5];
  [nativeAdQueue loadAdOfType:APDNativeAdType];
}

Using NativeAdQueue delegates

@interface YourViewController : UIViewController <APDNativeAdQueueDelegate>

Implement the following functions:

- (void)adQueueAdIsAvailable:(APDNativeAdQueue *)adQueue ofCount:(NSInteger)count;

- (void)adQueue:(APDNativeAdQueue *)adQueue failedWithError:(NSError *)error;

Get all native ad from nativeAdQueue

#import "APDNativeAdQueue.h"
@interface YourViewController : UIViewController
@property (nonatomic, strong) APDNativeAdQueue* nativeAdQueue;

- (void)viewDidLoad{
  nativeAdQueue = [APDNativeAdQueue new];
  [nativeAdQueue setMaxAdSize:5];
  [nativeAdQue setDelegate:self];
  [nativeAdQueue loadAdOfType:APDNativeAdType];
}

- (void)adQueueAdIsAvailable:(APDNativeAdQueue *)adQueue ofCount:(NSInteger)count {
  // - (NSArray <__kindof APDNativeAd *> *)getNativeAdsOfCount:(NSInteger)count;
  NSArray * nativeAds = [adQueue getNativeAdsOfCount:5];
}

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 sound to mute while playing video. For example, you can unmute ad by usage:

  mediaView.muted = NO;

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. Size of this icon should be 24x24 or more. If this element not required by networks ad choices view, it will 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

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 [[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 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:AppodealAdTypeInterstitial forPlacement:@"PLACEMENT"];

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

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

Get reward for placement

[Appodeal rewardForPlacement:@"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 impression period (in seconds) for interstitials and rewarded video shown with the placement. If the period between two impression is less than impression period, the 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 than 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 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: YES]

Log level

[Appodeal 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 (allows banner to resize automatically to fit device screen)

[Appodeal setSmartBannersEnabled:YES]

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

[Appodeal.setBannerBackgroundVisible: YES]

Banner animation

[Appodeal.setBannerAnimationEnabled:YES]

Checking if ad is loaded

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

Caching ads with adType

[Appodeal cacheAd:AppodealAdTypeBanner];
[Appodeal cacheAd:AppodealAdTypeInterstitial];
[Appodeal cacheAd:AppodealAdTypeRewardedVideo];

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

[Appodeal setAutocache: NO types:AppodealAdTypeInterstitial];
[Appodeal setAutocache: NO types: (AppodealAdTypeInterstitial | AppodealAdTypeBanner)];
[Appodeal setAutocache: NO types: (AppodealAdTypeInterstitial | AppodealAdTypeRewardedVideo | AppodealAdTypeBanner)];

Disabling networks for ad types (should be used before SDK initialising)

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

Setting location tracking (should be used before SDK initialising)

[Appodeal setLocationTracking:YES];

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"];
[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"];

Change Log

  • 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

Changelog

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