Wiki

Clone wiki

Fairlight / Ads

Fairlight has a central ad manager that supports various ad providers as well as a very simple custom provider.

Configuration via INI

First you should create a new INI-File that looks like that: (If you don't want to use a provider at alle just remove the whole section).

#!ini

[general]
cooldownInMinutes = 60
onlyShowEveryNThAd = 1
dontShowFirstAdOnAppStart = 0

[revmob]
iosAppId = 123
amazonAppId = 456
googlePlayAppId = 789
weight = 1

[intermediaware]
server = http//adfile/id/oceanpuzzle/lang/de
trackingPixel = http://server/trackingpixel.png?id=oceanpuzzle
parentalGate = 1
weight = 1

[chartboost]
iosAppId = xxxxxxxx
iosAppSignature = xxxxxxxx
amazonAppId = xxxxxxxx
amazonAppSignature = xxxxxxxx
googleAppId = xxxxxxxx
googleAppSignature = xxxxxxxx
weight = 1

[vungle]
iosAppId = xxxxxxxx
androidAppId = xxxxxxxx
weight = 1

[appodeal]
googlePlayAppId=xxxxxx
iosAppId= xxxxxxx xxx
interstatialRatio=4
videoRatio=1
weight=1

The weight parameter at the ad provider sections set the ratio which ad is displayed how often.

Set the following preprocessor variables if you want to use an AdProvider (so the correct provider files are included):

#!BlitzMax
#REVMOB_ADS = 1
#CHARTBOOST_ADS = 1
#VUNGLE_ADS = 1
#APPODEAL_ADS = 1

Here is a example code how the AdManager can be used:

#!BlitzMax
Local adManager := AdManager.Init("monkey://data/adConfig.ini"))

adManager.ShowFullscreen()

adManager.ShowBanner()

adManager.DisableAds() 'all further calls are ignored

Updated