Ads Interface


The idea is to provide common Ads interface for most of available ad frameworks, so that user's would not have to create a plugin for each of them separately, but rather it would be possible to wrap ad framework in single Java or Objective-C class (depending on the platform) and add it to the project, without even recompiling existing Ads Interface plugin.

Additionally it would be able to support multiple ad frameworks simultaneously so users could switch and fall back between ad frameworks on runtime.

What Ads Interface provides:

  • Using same interface not only across platforms, but also across ad frameworks
  • Providing ability to use multiple ad frameworks simultaneously
  • Easily create fall backs to other frameworks if one framework failed
  • Displaying and hiding banners
  • Preloading ads without showing them
  • Get dimensions and position banners as any other Gideros element
  • Tween banners using GTween
  • Place home ads (Bitmap objects) under banners, to display them if there is no ad or Internet connection
  • Enable test ads with one simple call (depends on ad framework)

Methods

  • Ads.new(adframework) -- initialize specified ad framework
  • Ads:setKey(value1, value2, ..., valueN) -- provide all the keys/appids/etc needed for the framework, which you will get in same order on Native part in Map object
  • Ads:loadAd(adType, value1, ..., valueN) --provide ad types and any other needed information, to preload an ad without showing it
  • Ads:showAd(adType, value1, ..., valueN) --provide ad types and any other needed information, to determine which type of ad to show on Native part
  • Ads:hideAd(adType) --hide ad with adType provided in showAd
  • Ads:enableTesting() --enables test ads if framework supports it
  • Ads:setAlignment(horizontal, vertical) --set add alignment if possible
  • Ads:setPosition(x, y) --set position (banners only)
  • Ads:setX(x) --set x position (banners only)
  • Ads:setY(y) --set y position (banners only)
  • Ads:getX(x) --get x position (banners only)
  • Ads;getY(y) --get y position (banners only)
  • Ads:getPosition() --get x and y position (banners only)
  • Ads:getWidth() --get width of ad (banners only)
  • Ads:getHeight() --get height of ad (banners only)
  • Ads:get(property) --generic getter for x and y properties(banners only)
  • Ads:set(property, value) --generic setter for x and y properties(banners only)

Events

  • Event.AD_RECEIVED --ad is displayed
    • e.type -- adType
  • Event.AD_FAILED --ad could not be displayed
    • e.error - error message
    • e.type -- adType
  • Event.AD_ACTION_BEGIN --some action on ad begun
    • e.type -- adType
  • Event.AD_ACTION_END --some action on ad completed
    • e.type -- adType
  • Event.AD_DISMISSED --ad is dismissed/removed
    • e.type -- adType
  • Event.AD_DISPLAYED --ad is displayed on the screen
    • e.type -- adType
  • Event.AD_ERROR --there was internal developer error
    • e.error - error message
    • e.type -- adType
  new setKey showAd/loadAd hideAd enableTesting positions
AdColony
adcolony = Ads.new("adcolony")
adcolony:setKey(appID, videoZoneID, optionalZoneID)
--load/display video
adcolony:showAd("video")
adcolony:showAd("video", videoZoneID)
--display video for currency
adcolony:showAd("v4vc"[, videoZoneID])
--offer video for currency
adcolony:showAd("v4vc"[, videoZoneID, true])
does nothing
does nothing
does nothing
Admob
admob = Ads.new("admob")
admob:setKey(appID)
--smart banner
admob:showAd("auto", unitID)
admob:showAd("banner", unitID)
admob:showAd("iab_banner", unitID)
admob:showAd("iab_leaderboard", unitID)
admob:showAd("iab_mrect", unitID)
admob:showAd("iab_skyscaper", unitID)
admob:showAd("smart_banner", unitID)
admob:showAd("interstitial", unitID)
--hides only banners
admob:hideAd(adType)
enables test ads
banners only
Amazon
amazon = Ads.new("amazon")
amazon:setKey(appID)
--determines size based on screen resolution
amazon:showAd("auto")
-- or
amazon:showAd("300x50")
amazon:showAd("320x50")
amazon:showAd("300x250")
amazon:showAd("600x90")--android only
amazon:showAd("728x90")
amazon:showAd("1024x50")

--interstitial
amazon:showAd("interstitial")
amazon:hideAd(adType)
enables test ads
works for banners
AppLovin
applovin = Ads.new("applovin")
applovin:setKey(appID)
applovin:showAd("auto")
applovin:showAd("banner")
applovin:showAd("leader")--android only
applovin:showAd("mrec")--android only
applovin:showAd("interstitial")
--hides only banners
applovin:hideAd(adType)
testing is enabled form website
banners only
Chartboost
chartboost = Ads.new("chartboost")
chartboost:setKey(appID, appSignature)
--interstitial
chartboost:showAd("interstitial")
chartboost:showAd("moreapps")
chartboost:showAd("v4vc")
chartboost:showAd("feed") --ios only
does nothing
does nothing
does nothing
HeyZap
heyzap = Ads.new("heyzap")
-- required for iOS
-- does nothing on Android
heyzap:setKey(appID)
--interstitial
heyzap:showAd("interstitial")
heyzap:showAd("video")
heyzap:showAd("v4vc")
does nothin
does nothing
does nothing
iAds
iad = Ads.new("iad")
does nothing
--interstitial
iad:showAd("interstitial")
--auto sized banner
iad:showAd("banner")
--hides only banners
iad:hideAd(adType)
does nothing
works for banners
InMobi
inmobi = Ads.new("inmobi")
inmobi:setKey(appID)
--auto sized banner
inmobi:showAd("auto")
--or
inmobi:showAd("300x250")
inmobi:showAd("728x90")
inmobi:showAd("468x60")
inmobi:showAd("120x600")
inmobi:showAd("320x50")
--hides only banners
inmobi:hideAd(adType)
does nothing
works for banner
Millenial
mm = Ads.new("millenial")
mm:setKey(appID) --default ID to use
--optionally can provide APID as second parameter
mm:showAd("auto")
mm:showAd("banner")
mm:showAd("med_banner")
mm:showAd("iab_leaderboard")
mm:showAd("rectangle")
mm:showAd("interstitial")
mm:hideAd(adType)
does not do anything
banners only
MoPub
mopub = Ads.new("mopub")
--set default ad unit 
--(optional if you 
--provide it for each ad separately)
mopub:setKey(adunit)
--if ad unit is not provided
--will use default ad unit
--set by setKey method
mopub:showAd("banner")
mopub:showAd("interstitial")


--or you can provide different ad unit
--for each ad
mopub:showAd("banner", adunit)
mopub:showAd("interstitial", adunit)
--hides only banner
mopub:hideAd(adType)
does nothing
banners sizes are reported only after ad is received
Revmob
revmob = Ads.new("revmob")
revmob:setKey(appId)
--auto sized banner
revmob:showAd("auto")
--or
revmob:showAd("interstitial")
revmob:showAd("link")
revmob:showAd("popup")
--hides banner ads
revmob:hideAd(adType)
enables test ads
banners may report height as 0
Samsung AdHub
samsung = Ads.new("samsung")
--set default inventoryID 
--(optional if you 
--provide it for each ad separately)
samsung:setKey(inventoryID)
--auto sized banner
samsung:showAd("auto")
--or
samsung:showAd("small_banner")
samsung:showAd("rectangle_banner")
samsung:showAd("medium_banner")
samsung:showAd("large_banner")
--or interstitial
samsung:showAd("interstitial")
--or video ad
samsung:showAd("video")

--you can also specify 
--another inventory ID 
--as second parameter
samsung:showAd("small_banner", inventoryID)
samsung:showAd("interstitial", inventoryID)
--etc
--hides only banners
samsung:hideAd(adType)
does nothing
positions only banners
TapForTap
tapfortap = Ads.new("tapfortap")
tapfortap:setKey(APIKEY)
tapfortap:showAd("banner")
tapfortap:showAd("interstitial")
tapfortap:showAd("moreapps")
--hides banner
tapfortap:hideAd(adType)
--enables test ads
tapfortap:enableTesting()
only for banners
TapJoy
taphoy = Ads.new("tapjoy")
tapjoy:setKey(appId, secretKey)
--auto sized banner
tapjoy:showAd("auto")
--or
tapjoy:showAd("320x50")
tapjoy:showAd("640x100")
tapjoy:showAd("768x90")
--or interstitial
tapjoy:showAd("interstitial")
--or offers
tapjoy:showAd("offers")
--hides banner ads
tapjoy:hideAd(adType)
does nothing
banners only
Vungle
vungle = Ads.new("vungle")
vungle:setKey("yourAppID")
--display video ad
vungle:showAd("video")
--display video for currency
vungle:showAd("v4vc"[, "username"])
does nothing
does nothing
does nothing

Legend:

Alpha
Beta
Stable
  AD_RECEIVED AD_FAILED AD_ACTION_BEGIN AD_ACTION_END AD_DISMISSED AD_DISPLAYED
AdColony
When video started
Failed to receive video or no available ad
 
successfully watched video for currency
Video finished
Ad displayed on the screen
Admob
When ad received
Failed to receive ad
   
When ad removed/destroyed
Ad displayed on the screen
Amazon
When ad loaded
When failed to load the ad
When ad expands/opens
When ad collapses
When ad removed from screen
Ad displayed on the screen
AppLovin
When ad received
Failed to receive ad
   
When ad removed/destroyed
Ad displayed on the screen
Chartboost
When ad displayed
When failed to load ad
When clicked ad
When closed ad or v4vc should reward user
When ad removed from screen
Ad displayed on the screen
HeyZap
When ad is displayed
When failed to load ad
When ad clicked
When user successfully watched video for virtually currency
When ad gets removed
Ad displayed on the screen
iAds
When ad is displayed
When failed to load
When clicked on ad
when returned from the ad after cliking it
When ad dismissed
Ad displayed on the screen
InMobi
When ad showed
When failed to load
   
When ad dismissed
Ad displayed on the screen
Millenial
When ad received
Failed to receive ad
   
When ad removed/destroyed
Ad displayed on the screen
MoPub
ad is received
failed to receive ad
on ad expand
on ad collapse
ad removed from screen
Ad displayed on the screen
Revmob
When ad received
When ad failed
On user click
 
when ad dismissed
Ad displayed on the screen
Samsung AdHub
when ad is displayed
when could not retrieve ad
   
when ad is closed or removed
Ad displayed on the screen
TapForTap
When ad is received
Failed to receive ad
When clicked on ad
 
When ad removed from screen
Ad displayed on the screen
TapJoy
When ad received
When ad failed
     
Ad displayed on the screen
Vungle
When video started
Failed to receive video or no available ad
 
watched at least 80% 
of video ad
or video for currency
Video finished
Ad displayed on the screen

Legend:

Alpha
Beta
Stable

Choose the frameworks you will use and delete all the unneeded based on file dependency table for each framework below

Copy libs folder into your exported project

Copy src folder into your exported project

Add System.loadLibrary("ads"); to your main activity

Add "com.giderosmobile.android.plugins.ads.Ads" as external class in your main activity

Modify AndroidManifest application tag based on the frameworks you want to use using table below

Modify AndroidManifest permissions based on the frameworks you want to use using table below

  Application Permission Files
AdColony
<activity android:name="com.jirbo.adcolony.AdColonyOverlay" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
		<activity android:name="com.jirbo.adcolony.AdColonyFullscreen" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
		<activity android:name="com.jirbo.adcolony.AdColonyBrowser" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • /libs/adcolony.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsAdcolony.java
Admob
<!-- google play -->
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  • /src/com/giderosmobile/android/plugins/ads/fraeworks/AdsAdmob.java (GooglePlay version)
Amazon
<activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  • /libs/amazon-ads-version.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsAmazon.java
AppLovin
<!--Requies Google Play Services lib -->
<meta-data android:name="applovin.sdk.key"
       android:value="your-key"  />
<activity android:name="com.applovin.adview.AppLovinInterstitialActivity" />
<activity android:name="com.applovin.adview.AppLovinConfirmationActivity" />
<!-- These permissions are mandatory to run AppLovin SDK -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- These permissions are strongly recommended and will result in higher performance -->

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  • /libs/applovin-sdk-version.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsApplovin.java
Chartboost
<activity android:name="com.chartboost.sdk.CBImpressionActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:excludeFromRecents="true" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  • /libs/chartboost.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsChartboost.java
HeyZap
<activity android:name="com.heyzap.sdk.ads.HeyzapInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapVideoActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<receiver android:name="com.heyzap.sdk.ads.PackageAddedReceiver">
    	<intent-filter>
        	<data android:scheme="package"/>
        	<action android:name="android.intent.action.PACKAGE_ADDED"/>
    	</intent-filter>
</receiver>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  • /libs/heyzap-ads-sdk.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsHeyzap.java
InMobi
 <activity android:name="com.inmobi.androidsdk.IMBrowserActivity" android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize" android:hardwareAccelerated="true" />
<receiver
            android:name="com.inmobi.commons.analytics.androidsdk.IMAdTrackerReceiver"
            android:enabled="true"
            android:exported="true" >
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • /libs/InMobiAdNetwork-version.jar
  • /libs/InMobiCommons-version.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsInmobi.java
Millenial
<activity android:name="com.millennialmedia.android.MMActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="keyboardHidden|orientation|keyboard" ></activity>
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />  
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  • /libs/MMSDK.jar
  • /libs/nmdp_speech_kit.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsMillenial.java
MoPub
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidBrowser" android:configChanges="keyboardHidden|orientation"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  • /libs/mopub-sdk.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsMopub.java
Revmob
<activity android:name="com.revmob.ads.fullscreen.FullscreenActivity" android:theme="@android:style/Theme.Translucent" android:configChanges="keyboardHidden|orientation"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  • /libs/revmob-version.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsRevmob.java
Samsung AdHub
<activity android:name="com.sec.android.ad.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
  • /libs/SamsungAdHub_AndroidSDK_version_global.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsSamsung.java
TapForTap
<activity android:name="com.tapfortap.FullScreenAdActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  • /libs/TapForTap.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsTapfortap.java
TapJoy
<activity android:name="com.tapjoy.TJCOffersWebView" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.TapjoyFullScreenAdWebView" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.TapjoyDailyRewardAdWebView" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.TapjoyVideoView" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.TJAdUnitView" android:configChanges="orientation|keyboardHidden|screenSize" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" android:hardwareAccelerated="true" />
<activity android:name="com.tapjoy.mraid.view.ActionHandler" android:configChanges="orientation|keyboardHidden|screenSize" />
<activity android:name="com.tapjoy.mraid.view.Browser" android:configChanges="orientation|keyboardHidden|screenSize" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  • /libs/tapjoyconnectlibrary.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsTapjoy.java
Vungle
<activity android:name="com.vungle.sdk.VungleAdvert" android:configChanges="keyboardHidden|orientation|screenSize" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<service android:name="com.vungle.sdk.VungleIntentService"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  • /libs/vungle-publisher-version.jar
  • /src/com/giderosmobile/android/plugins/ads/frameworks/AdsVungle.java

Legend:

Alpha
Beta
Stable

Choose the frameworks you will use and delete all the unneeded based on file dependency table for each framework below

Copy contents of Plugins directory into your exported project's Plugins directory

Add copied files to your Xcode project (Check create groups for added folders)

Add IOS frameworks that is required by your selected Ad provider from table below

  1. In the project navigator, select your project
  2. Select your target
  3. Select the 'Build Phases' tab
  4. Open 'Link Binaries With Libraries' expander
  5. Click the '+' button
  6. Select framework
  7. Click Add

Note: SystemConfiguration.framework is required by default

Add Other Linker flags that is required by your selected Ad provider from table below

  Frameworks Linker Files
AdColony
  • libz.1.2.5.dylib
  • AdColony.framework
  • AdSupport.framework (Set to Optional)
  • AudioToolbox.framework
  • AVFoundation.framework
  • CoreGraphics.framework
  • CoreMedia.framework
  • CoreTelephony.framework
  • EventKit.framework
  • EventKitUI.framework
  • MediaPlayer.framework
  • MessageUI.framework
  • QuartzCore.framework
  • Social.framework (Set to Optional)
  • StoreKit.framework (Set to Optional)
  • SystemConfiguration.framework
  • -ObjC
  • -fobjc-arc
  • /Plugins/Ads/AdColony.framework folder
  • /Plugins/Ads/AdsAdcolony.h
  • /Plugins/Ads/AdsAdcolony.m
Admob
  • AdSupport
  • AudioToolbox
  • AVFoundation
  • CoreGraphics
  • CoreTelephony
  • EventKit
  • EventKitUI
  • MessageUI
  • StoreKit
  • SystemConfiguration
  • -ObjC
  • /Plugins/Ads/Admob folder
  • /Plugins/Ads/AdsAdmob.h
  • /Plugins/Ads/AdsAdmob.m
Amazon
  • AdSupport
  • CoreLocation
  • SystemConfiguration
  • CoreTelephony
  • MediaPlayer
 
  • /Plugins/Ads/AmazonAd.framework
  • /Plugins/Ads/AdsAmazon.h
  • /Plugins/Ads/AdsAmazon.m
AppLovin
  • AdSupport
  • CoreTelephony
  • CoreGraphics
  • MediaPlayer
  • SystemConfiguration
  • UIKit
  • -ObjC
  • /Plugins/Ads/Applovin folder
  • /Plugins/Ads/AdsApplovin.h
  • /Plugins/Ads/AdsApplovin.m
Chartboost
  • QuartzCore
  • SystemConfiguration
  • CoreGraphics
  • AdSupport
  • StoreKit
  • CoreMedia
  • AVFoundation
  • CoreData
 
  • /Plugins/Ads/Chartboost.framework
  • /Plugins/Ads/AdsChartboost.h
  • /Plugins/Ads/AdsChartboost.m
HeyZap
  • StoreKit
  • QuartzCore
  • CoreGraphics
  • AdSupport
  • -ObjC
  • /Plugins/Ads/HeyzapAds.framework
  • /Plugins/Ads/AdsHeyzap.h
  • /Plugins/Ads/AdsHeyzap.m
iAds
  • iAd
 
  • /Plugins/Ads/AdsIad.h
  • /Plugins/Ads/AdsIad.m
InMobi
  • AdSupport.framework
  • AudioToolbox.framework
  • AVFoundation.framework
  • CoreTelephony.framework
  • MessageUI.framework
  • MediaPlayer.framework
  • Security.framework
  • SystemConfiguration.framework
  • StoreKit.framework
  • libsqlite3.0.dylib
  • libz.dylib
  • -ObjC
  • /Plugins/Ads/InMobi folder
  • /Plugins/Ads/AdsInmobi.h
  • /Plugins/Ads/AdsInmobi.m
MoPub
  • AdSupport.framework (*)
  • AudioToolbox.framework
  • AVFoundation.framework
  • CoreGraphics.framework
  • CoreLocation.framework
  • CoreTelephony.framework
  • iAd.framework
  • MediaPlayer.framework
  • MessageUI.framework
  • MobileCoreServices.framework
  • EventKit.framework
  • EventKitUI.framework
  • PassKit.framework (*)
  • QuartzCore.framework
  • Social.framework (*)
  • StoreKit.framework (*)
  • SystemConfiguration.framework
  • Twitter.framework (*)
  • -ObjC
  • /Plugins/Ads/MoPubSDK folder
  • /Plugins/Ads/AdsMopub.h
  • /Plugins/Ads/AdsMopub.m
Revmob
  • SystemConfiguration.framework
  • StoreKit.framework
  • AdSupport.framework
 
  • /Plugins/Ads/Revmob.framework folder
  • /Plugins/Ads/AdsRevmob.h
  • /Plugins/Ads/AdsRevmob.m
Samsung AdHub
  • AVFoundation.framework
  • CoreMedia.framework
  • AudioToolBox.framework
  • SystemConfiguration.framework
  • QuartzCore.framework.
  • MobileCoreServices.framework
  • MessageUI.framework
  • Foundation.framework
  • EventKit.framework
  • EventKitUI.framework
  • CoreMotion.framework
  • CoreLocation.framework
  • CoreFoundation.framework
  • CFNetwork.framework
  • MapKit.framework
  • MediaPlayer.framework
  • CoreTelephony.framework
  • UIKit.framework
  • CoreGraphics.framework
  • AdSupport.framework
  • libz.dylib
  • libsqlite3.0.dylib
  • -all_load
  • –ObjC
  • /Plugins/Ads/SamsungadHub folder
  • /Plugins/Ads/AdsSamsung.h
  • /Plugins/Ads/AdsSamsung.m
TapForTap
  • SystemConfiguration.framework
  • AdSupport.framework
 
  • /Plugins/Ads/TapForTap/libTapForTap.a
  • /Plugins/Ads/TapForTap/TFTAppWall.h
  • /Plugins/Ads/TapForTap/TFTBanner.h
  • /Plugins/Ads/TapForTap/TFTInterstitial.h
  • /Plugins/Ads/TapForTap/TFTTapForTap.h
  • /Plugins/Ads/AdsTapfortap.h
  • /Plugins/Ads/AdsTapfortap.m
TapJoy
  • AdSupport (Optional)
  • CFNetwork
  • CoreGraphics
  • CoreLocation
  • CoreMotion
  • CoreTelephony (Optional)
  • EvenKitUI
  • EventKit
  • Foundation
  • libsqlite3.0
  • libxml2
  • libz
  • MapKit
  • MediaPlayer
  • MessageUI
  • MobileCoreServices
  • QuartzCore
  • Social (Optional)
  • StoreKit
  • SystemConfiguration
  • Twitter
  • UIKit
 
  • /Plugins/Ads/Tapjoy.embeddedframework
  • /Plugins/Ads/AdsTapjoy.h
  • /Plugins/Ads/AdsTapjoy.m
Vungle
  • AVFoundation.framework
  • CFNetwork.framework
  • CoreGraphics.framework
  • AudioToolbox.framework
  • CoreMedia.framework
  • Foundation.framework
  • libz.dylib
  • MediaPlayer.framework
  • QuartzCore.framework
  • SystemConfiguration.framework
  • UIKit.framework
  • AdSupport.framework
  • StoreKit.framework
  • CoreLocation.framework
  • -ObjC
  • /Plugins/Ads/vunglepub.embeddedframework folder
  • /Plugins/Ads/AdsVungle.h
  • /Plugins/Ads/AdsVungle.m

Legend:

Alpha
Beta
Stable

--require plugin
require "ads"

--initialize amazon
amazon = Ads.new("amazon")
amazon:setKey("amazon-key")

--initialize admob
admob = Ads.new("admob")
admob:setKey("admob-key")

--if amazon fails
--show admob
amazon:addEventListener(Event.AD_FAILED, function(e)
	print("amazon AD_FAILED", e.error)
	admob:showAd("auto")
end)

--if admob fails
--show amazon
admob:addEventListener(Event.AD_FAILED, function(e)
	print("admob AD_FAILED", e.error)
	amazon:showAd("auto")
end)

--start displaying amazon ads
amazon:showAd("auto");