SDK Integration | Appodeal Intelligent Ad Mediation

SDK Integration

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

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


The extension source code is available at

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.



Starting from March 1, 2018, we will cease supporting Cordova framework. See more details here.

Download SDK

To install Appodeal Cordova Plugin to your project simply run following command:

cordova plugin add

If you're using MultiDex in your application, use this plugin:

cordova plugin add

If you're not using MultiDex in your application and encountering 65K methods limit, use this plugin:

cordova plugin add

Google Play Services already included to plugin dependencies.

If you have issues while installing plugin, follow the Command-line Interface Guide.

Minimum OS requirements: iOS 8.1, Android API level 14 (Android OS 4.0).

Android Appodeal SDK version 2.1.4

iOS Appodeal SDK version 2.1.4


All required changes to AndroidManifest.xml are already included in the plugin.

Note: you can remove optional permissions in plugin.xml from plugins/com.appodeal.plugin if you don't want to use it. Following permissions are optional:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!--optional -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!--optional -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!--optional-->

Cordova Integration

Ad Types





Ad types can be combined using "|" operator. For example Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO.

SDK Initialization

To initialize SDK, call the following code:

  var appKey = "fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f";
  Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.REWARDED_VIDEO | Appodeal.BANNER);

To initialize only interstitials use Appodeal.initialize(appKey, Appodeal.INTERSTITIAL)

To initialize only rewarded video use Appodeal.initialize(appKey, Appodeal.REWARDED_VIDEO)

To initialize only non-skippable video use Appodeal.initialize(appKey, Appodeal.NON_SKIPPABLE_VIDEO)

To initialize interstitials and non-skippable videos use Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO)

To initialize only banners use Appodeal.initialize(appKey, Appodeal.BANNER)

Display Ad

To display ad you need to call the following code:;

To display interstitial use

To display rewarded video use

To display non-skippable video use

To display interstitial or non-skippable video use | Appodeal.NON_SKIPPABLE_VIDEO)

To display banner at the bottom of the screen use

To display banner at the top of the screen use, function(result){ // result is a boolean value, that is indicates whether show call was passed to appropriate SDK });


Display interstitial

To display interstitial you need to call the following code:;

Checking if interstitial is loaded

Appodeal.isLoaded(Appodeal.INTERSTITIAL, function(result){
    // result returns bool value

Setting Interstitial callbacks

Appodeal.setInterstitialCallbacks( function(container) {
       if (container.event == 'onLoaded') {
            console.log("Appodeal. Interstitial. " + container.event + ", isPrecache: " + container.isPrecache  );
            // your code
       } else if (container.event == 'onFailedToLoad') {
            // your code
       } else if (container.event == 'onShown') {
            // your code
       } else if (container.event == 'onClick') {
            // your code
       } else if (container.event == 'onClosed') {
            // your code

Rewarded Video

Display Rewarded (Non-skippable) Video;

Checking if rewarded video is loaded

Appodeal.isLoaded(Appodeal.REWARDED_VIDEO, function(result){});

Getting reward data for placement

To get placement reward data before video is shown use:

Appodeal.getRewardParameters( function(result) {
   console.log("Appodeal Reward Amount:" + result.amount);
   console.log("Appodeal Reward Currency:" + result.currency);

This method returns callback with reward amount and currency

Setting rewarded video callbacks

Appodeal.setRewardedVideoCallbacks( function(container) {
       if (container.event == 'onLoaded') {
            // your code
       } else if (container.event == 'onFailedToLoad') {
            // your code
       } else if (container.event == 'onShown') {
            // your code
       } else if (container.event == 'onFinished') {
            // container also returns "name" and "amount" variables with reward amount and currency name you have set for your application
            console.log( "Appodeal. Rewarded. " + container.event + ", amount: " + container.amount + ", name: " +;
            // your code
       } else if (container.event == 'onClosed') {
            // container also returns "finished" variable with boolean value for indicating if video was finished
            console.log("Appodeal. Rewarded. " + container.event + ", finished: " + container.finished);
            // your code

Banner Integration

Display banner at the top/bottom of the screen;

Display banner at the top of the screen;

Checking if banner is loaded

Appodeal.isLoaded(Appodeal.BANNER, function(result){});

Hiding banner


Setting banner callbacks

Appodeal.setBannerCallbacks( function(container) {
       if (container.event == 'onLoaded') {
            console.log("Appodeal. Banner. " + container.event + ", height: " + container.height + ", isPrecache: " + container.isPrecache);
            // your code
       } else if (container.event == 'onFailedToLoad') {
            // your code
       } else if (container.event == 'onShown') {
            // your code
       } else if (container.event == 'onClick') {
            // your code

Enabling 728*90 banners

To enable 728*90 banner use the following method:


Disabling banner refresh animation

To disable banner refresh animation use:


Disabling smart banners


Hiding Banner

To hide banner you need to call the following code in activity:


Advanced Features

Enabling test mode


In test mode test ads will be shown and debug data will be written to log

Enabling logging


Available parameters: Appodeal.LogLevel.none, Appodeal.LogLevel.debug, Appodeal.LogLevel.verbose

Enables debug logging.

Checking if loaded ad is precache

Appodeal.isPrecache(adTypes, function(result){
  // result is a boolean value, that equals true if ad is precache

Currently supported only for interstitials and banners

To check if loaded interstitial is precache: use Appodeal.isPrecache(Appodeal.INTERSTITIAL);

To check if loaded banner is precache: use Appodeal.isPrecache(Appodeal.BANNER);

Manual ad caching


You should disable automatic caching before SDK initialization using setAutoCache(adTypes, false).

To cache interstitial use Appodeal.cache(Appodeal.INTERSTITIAL)

To cache rewarded video use Appodeal.cache(Appodeal.REWARDED_VIDEO)

To cache interstitial and non-skippable video use Appodeal.cache(Appodeal.INTERSTITIAL | Appodeal.NON_SKIPPABLE_VIDEO)

To cache banner use Appodeal.cache(Appodeal.BANNER)

Enabling or disabling automatic caching

Appodeal.setAutoCache(adTypes, false);

Should be used before SDK initialization

To disable automatic caching for interstitials use Appodeal.setAutoCache(Appodeal.INTERSTITIAL, false)

To disable automatic caching for rewarded videos use Appodeal.setAutoCache(Appodeal.REWARDED_VIDEO, false)

To disable automatic caching for banners use Appodeal.setAutoCache(Appodeal.BANNER, false)

Triggering onLoaded callback on precache

Appodeal.setTriggerOnLoadedOnPrecache(adTypes, true);

Currently supported only for interstitials

setOnLoadedTriggerBoth(Appodeal.INTERSTITIAL, false) - onInterstitialLoaded will trigger only when normal ad was loaded (default)..

setOnLoadedTriggerBoth(Appodeal.INTERSTITIAL, true) - onInterstitialLoaded will trigger twice, both when precache and normal ad were loaded..

Should be used before SDK initialization

Disabling data collection for kids apps


Disabling networks


Available parameters: "adcolony", "admob", "amazon_ads", "applovin", "appnext", "avocarrot", "chartboost", "facebook", "flurry", "inmobi", "inner-active", "ironsource", "mailru", "mmedia", "mopub", "ogury", "openx", "pubnative", "smaato", "startapp", "tapjoy", "unity_ads", "vungle", "yandex"

Should be used before SDK initialization

Disabling location permission check

To disable toast messages ACCESS_COARSE_LOCATION permission is missing, use the following method:


Should be used before SDK initialization.

Disabling write external storage permission check

To disable toast messages WRITE_EXTERNAL_STORAGE permission is missing use the following method:


Disables all ad networks that need this permission may lead to low video fillrates

Should be used before SDK initialization

Tracking in-app purchase

Appodeal.trackInAppPurchase(this, 5, "USD");

Testing third-party networks adapters integration

To show test screen for testing adapters integration call:


Muting videos if call volume is muted


Setting User Data

Set the age of the user


Specify gender of the user


Possible values: Appodeal.Gender.FEMALE, Appodeal.Gender.MALE, Appodeal.Gender.OTHER.

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


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.showWithPlacement(adTypes, placementName);

To check if ad can be shown for the specific placement use:

Appodeal.canShowWithPlacement(adTypes, placementName, function(result) {
    if(result) { // returns true or false 
        // your code

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

You can check more examples here

Proguard Settings

If you are using Proguard

If you are using Proguard add the following to your Proguard config file:

# Appodeal
-keep class com.appodeal.** { *; }
-keep class org.nexage.** { *; }
-keepattributes EnclosingMethod, InnerClasses, Signature, JavascriptInterface

# Amazon
-keep class** { *; }

# Mopub
-keep public class com.mopub.**
-keepclassmembers class com.mopub.** { public *; }
-dontwarn com.mopub.**
-keep class * extends com.mopub.mobileads.CustomEventBanner {}
-keepclassmembers class com.mopub.mobileads.CustomEventBannerAdapter {!private !public !protected *;}
-keep class * extends com.mopub.mobileads.CustomEventInterstitial {}
-keep class * extends com.mopub.nativeads.CustomEventNative {}
-keep class * extends com.mopub.mobileads.CustomEventRewardedVideo {}
-dontwarn com.mopub.volley.toolbox.**
-keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; } 

# Applovin
-keep class com.applovin.** { *; }
-dontwarn com.applovin.**

# Facebook
-keep class** { *; }
-keeppackagenames com.facebook.*

# Chartboost
-keep class com.chartboost.** { *; }
-dontwarn com.chartboost.**

# Unity Ads
-keepattributes SourceFile,LineNumberTable
-keep class com.unity3d.** { *; }
-dontwarn com.unity3d.**

# Yandex
-keep class** { *; }
-keep class** { *; }
-keepattributes *Annotation*

# StartApp
-keep class com.startapp.** { *;}
-dontwarn com.startapp.**
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, SourceFile, LineNumberTable, *Annotation*, EnclosingMethod

# Flurry
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
-keepattributes *Annotation*,EnclosingMethod,Signature
-keepclasseswithmembers class * {
  public <init>(android.content.Context, android.util.AttributeSet, int);

# Avocarrot
-keep class com.avocarrot.** { *; }
-keepclassmembers class com.avocarrot.** { *; }
-dontwarn com.avocarrot.**
-keep public class * extends android.view.View {
  public <init>(android.content.Context);
  public <init>(android.content.Context, android.util.AttributeSet);
  public <init>(android.content.Context, android.util.AttributeSet, int);
  public void set*(...);

# Adcolony
-keep class com.jirbo.adcolony.** { *;}
-keep class com.adcolony.** { *;}
-keep class com.immersion.** { *;}
-dontnote com.immersion.**
-dontwarn android.webkit.**
-dontwarn com.jirbo.adcolony.**
-dontwarn com.adcolony.**

# Vungle
-keepattributes *Annotation*, Signature
-keep class com.vungle.** { *;}
-dontwarn com.vungle.**
-keep class** { *;}
-keep class dagger.**
-keep class de.greenrobot.event.**
-keep class javax.inject.**
-keep class rx.**

# MyTarget
-keep class** { *; }

# Admob
-keep class** { *; }

# Tapjoy
-keep class com.tapjoy.** { *; }
-dontwarn com.tapjoy.**

# IronSource
-keepclassmembers class com.ironsource.sdk.controller.IronSourceWebView$JSInterface { public *; }
-keepclassmembers class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; }
-keep class com.ironsource.** { *; }
-dontwarn com.ironsource.**

# AdColonyV3
-keepclassmembers class * { @android.webkit.JavascriptInterface <methods>; }
-keep class com.adcolony.** { *; }
-dontwarn com.adcolony.**

-keep class com.appnext.** { *; }
-dontwarn com.appnext.**

# Inmobi
-keep class com.inmobi.** { *; }
-dontwarn com.inmobi.**
-dontwarn com.squareup.picasso.**
-keep class com.squareup.picasso.** {*;}
-dontwarn com.squareup.picasso.**
-dontwarn com.squareup.okhttp.**
-keep class com.moat.** {*;}
-dontwarn com.moat.**

# MMdeia
-keepclassmembers class com.millennialmedia** {public *;}
-keep class com.millennialmedia**
-dontwarn com.millennialmedia.**

# Ogury
-dontwarn io.presage.**
-dontnote io.presage.**
-dontwarn shared_presage.**
-dontwarn org.codehaus.**
-keepattributes Signature
-keep class shared_presage.** { *; }
-keep class io.presage.** { *; }
-keepclassmembers class io.presage.** { *; }
-keepattributes *Annotation*
-keepattributes JavascriptInterface
-keepclassmembers class * {
  @android.webkit.JavascriptInterface <methods>;
-dontnote okhttp3.**
-dontnote okio.**
-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault

-dontnote sun.misc.Unsafe

-dontnote org.apache.commons.codec.**
-dontnote org.apache.http.**

-dontwarn org.apache.commons.collections.BeanMap
-dontwarn java.beans.**
-keepclassmembers class * implements {
  static final long serialVersionUID;
  private static final[] serialPersistentFields;
  private void writeObject(;
  private void readObject(;
  java.lang.Object writeReplace();
  java.lang.Object readResolve();

# Google
-keep class {*;}
-keep class** { *; }

# Legacy
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**

# Google Play Services library
-keep class * extends java.util.ListResourceBundle {
  protected Object[][] getContents();
-keep public class {
  public static final *** NULL;
-keepnames class * implements android.os.Parcelable
-keepclassmembers class * implements android.os.Parcelable {
  public static final *** CREATOR;
-keep @interface
-keep class *
-keepclasseswithmembers class * { <fields>;
-keepclasseswithmembers class * { <methods>;
-keep @interface
-keepnames class *
-keepclassmembernames class * { *;
-keep @interface
-keep public class * {
  public <fields>;
  public <methods>;
-keep class {*;}
-keep class {*;}

# Google Play Services library 9.0.0 only
-keep public class * { *; }

# support-v4
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }
-keep class { *; }

# support-v7-recyclerview
-keep class { *; }
-keep class { *; }

Third-party SDKs versions

NetworkAndroid SDK versioniOS SDK version
Amazon Ads5.
Appnext2.0.3.459Not Supported
Facebook Audience Network4.
Ogury2.1.15Not Supported
Unity Ads2.
Yandex Metrica2.732.7.0
Yandex Mobile Ads2.602.7.0