SDK Integration | Appodeal

SDK Integration

  1. Manual

App key

Download SDK

To install Appodeal PhoneGap Plugin to your project add following to your config.xml:

<gap:plugin name="com.appodeal.plugin" source="npm"/>

Minimum OS requirements: Android API level 9 (Android OS 2.3).


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

PhoneGap Integration

Ad Types






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

Note that it is better to use NON_SKIPPABLE_VIDEO or REWARDED_VIDEO, but if you are sure you want to use SKIPPABLE_VIDEO you must confirm usage by calling Appodeal.confirm(Appodeal.SKIPPABLE_VIDEO) before SDK initialization

SDK Initialization

To initialize SDK, call the following code:

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

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

To initialize only skippable videos use Appodeal.initialize(appKey, Appodeal.SKIPPABLE_VIDEO)

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 videos use Appodeal.initialize(appKey, Appodeal.INTERSTITIAL | Appodeal.SKIPPABLE_VIDEO)

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

Display Ad;

To display interstitial use

To display skippable video use

To display rewarded video use

To display non-skippable video use

To display interstitial or video use | Appodeal.SKIPPABLE_VIDEO)

To display banner at the bottom of the screen use

To display banner at the top of the screen use

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

Hiding Banner

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



Display interstitial after it was loaded

Appodeal.setAutoCache(Appodeal.INTERSTITIAL, false);
Appodeal.initialize(appKey, Appodeal.INTERSTITIAL);
document.addEventListener('onInterstitialLoaded', function(){;

Display interstitial after app launch

Appodeal.initialize(appKey, Appodeal.INTERSTITIAL);;

Advanced Features

Checking if ad is loaded

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

To check if interstitial is loaded use Appodeal.isLoaded(Appodeal.INTERSTITIAL, function(result){})

To check if skippable video is loaded use Appodeal.isLoaded(Appodeal.SKIPPABLE_VIDEO, function(result){})

To check if rewarded video is loaded use Appodeal.isLoaded(Appodeal.REWARDED_VIDEO, function(result){})

To check if non-skippable video is loaded use Appodeal.isLoaded(Appodeal.NON_SKIPPABLE_VIDEO, function(result){})

To check if banner is loaded use Appodeal.isLoaded(Appodeal.BANNER, function(result){})

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 , Use Appodeal.isPrecache(Appodeal.INTERSTITIAL, function(result){})

Setting Interstitial callbacks


document.addEventListener('onInterstitialLoaded', function(){});
document.addEventListener('onInterstitialFailedToLoad', function(){});
document.addEventListener('onInterstitialShown', function(){});
document.addEventListener('onInterstitialClicked', function(){});
document.addEventListener('onInterstitialClosed', function(){});

Setting skippable video callbacks


document.addEventListener('onSkippableVideoLoaded', function(){});
document.addEventListener('onSkippableVideoFailedToLoad', function(){});
document.addEventListener('onSkippableVideoShown', function(){});
document.addEventListener('onSkippableVideoFinished', function(){});
document.addEventListener('onSkippableVideoClosed', function(){});

Setting rewarded video callbacks


document.addEventListener('onRewardedVideoLoaded', function(){});
document.addEventListener('onRewardedVideoFailedToLoad', function(){});
document.addEventListener('onRewardedVideoShown', function(){});
document.addEventListener('onRewardedVideoFinished', function(data){
  console.log('Reward:' + data.amount + ' ' +;  //data.amount  - amount of reward, - reward name
document.addEventListener('onRewardedVideoClosed', function(){});

Setting non-skippable video callbacks


document.addEventListener('onNonSkippableVideoLoaded', function(){});
document.addEventListener('onNonSkippableVideoFailedToLoad', function(){});
document.addEventListener('onNonSkippableVideoShown', function(){});
document.addEventListener('onNonSkippableVideoFinished', function(){});
document.addEventListener('onNonSkippableVideoClosed', function(){});

Setting banner callbacks


document.addEventListener('onBannerClicked', function(){});
document.addEventListener('onBannerFailedToLoad', function(){});
document.addEventListener('onBannerLoaded', function(){});
document.addEventListener('onBannerShown', function(){});

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 skippable video use Appodeal.cache(Appodeal.SKIPPABLE_VIDEO)

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

To cache interstitial and video use Appodeal.cache(Appodeal.INTERSTITIAL | Appodeal.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 skippable videos use Appodeal.setAutoCache(Appodeal.SKIPPABLE_VIDEO, 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.setOnLoadedTriggerBoth(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 networks


Available parameters: "amazon_ads", "applovin", "chartboost", "mopub", "unity_ads", "mailru", "facebook", "adcolony", "vungle", "yandex", "startapp", "avocarrot", "flurry", "pubnative", "cheetah", "inner-active", "revmob".

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.

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

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

-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 { *; }

Admob Adapter

Admob adapter for Appodeal is included with our jar.

To use it, do the following:

1. Go to your adUnit, click on “Mediation ad sources”

2. Add New ad network

3. Add new Custom Event:

Class Name -

Label - AppodealCustomEvent

Parameter - fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f


MoPub Adapter

MoPub adapter for Appodeal is included with our jar.

To use it, do the following:

1. On the MoPub Networks page click “Add Network”

2. Choose “Custom Native Network”

3. Enter the Custom Event Class information into the text boxes.

Custom Event Class - com.mopub.mobileads.AppodealCustomEventInterstitial

Custom Event Class Data - {"appKey":"fee50c333ff3825fd6ad6d38cff78154de3025546d47a84f"}