AdBanner Class
This class encapsulated banner ads (iAd for iPhone, iPod and iPad, AdMob for Android devices).
Example:
var banner = new AdBanner({provider:#simulate, testing:true});
banner.show(0, 0);
Item Index
Methods
Properties
Methods
_setDefaults
() private
Method is setting control's defaults variables set from current theme.
_setOptions
() private
Method is setting control's option variables. Options is present at the contstuct of the object after defaults are applied.
_setProperty
() private
Method is parsing options and set properties to the control. Options is a JSON object.
afterInit
() protected
Method is executed after inititialization of this object
beforeInit
() protected
Method is executed before inititialiation of this object
hide
()
This method hides ad banner.
init
()
Initializes banner ads.
Example:
var banner = new AdBanner({
provider:#auto,
adId:"a1504f8e07e325a", // AdMob ID for AdMob system
size:#smartPortrait,
testing:true
});
setDefaults
() protected
Method is setting default class values
setOptions
() protected
Method is setting options passed as class parameters
show
x
y
[testing=false]
This method creates and shows ad banner at specified position on screen.
Parameters:
Example:
var banner = new AdBanner({provider:#auto, adId:"a1504f8e07e325a", size:#smartPortrait, testing:true});
banner.show(0, 0);
Properties
defaults
Object
Sets default controls options
initialized
Boolean
options
Object
provider
Symbol
- #auto - automatically detects the best provider (iAd for iOS, AdMob for Android, otherwise simlulate banner ads)
- #AdMob - use AdMob (on both, iOS and Android)
- #iAd - use iAd (iOS only)
- #simulate - just simulate banner ads
undefined
Object
Special property (Undefined Property Handler - UPH) executed when property is undefined. It can be that JSON format is in format "key" : "value". Key is an string, so if this is the case methot return "value". As well as k is a regular property of the class it returns getter of this property
Sub-properties:
-
key
String -
value
Object