Banner

The Banner object is an advertising banner that will be created and automatically added into a specified div in your html.

Please Note:

Minimum requirement is BlackBerry® WebWorks SDK 2.1.
Set access to "blackberry.advertising" and "www.blackberry.com" in the app config.xml

<xml version="1.0" encoding="UTF-8" ?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="2.1" rim:header="RIM-Widget: rim/widget">
   <access subdomains="true" uri="http://www.blackberry.com/">
      <feature id="blackberry.advertising" required="true" version="1.0.0" />
   </access>
   <accesss subdomains="true" uri="*" />
</widget>


Beta Notice:

This API is considered to be in Beta. The function and property signatures listed below could change at anytime. Once the API moves out of Beta it will be distributed as part of the core API.

Sign up for the BlackBerry® Advertising Service
Development Guide - Advertising Service for BlackBerry WebWorks

Last Updated: Mon Feb 11 2013 14:51:02 GMT-0500 (EST)

Supported Platform(s)

- BlackBerry OS 6.0+
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
blackberry.advertising.Banner   Y Y       
bannerTransitions   Y Y       
focusBorderColor   Y Y       
focusBorderWidth   Y Y       
metadata   Y Y       
mmaSize   Y Y       
placeholder   Y Y       
refreshRate   Y Y       

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

You must declare the feature element(s) below in your configuration document:

Feature IDBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
<feature id="blackberry.advertising" />   Y Y       

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.


Properties

Constructors

blackberry.advertising.Banner (zoneId : Number, divId : String, [properties : JSON])

Creates a new Banner Object with the given properties and automatically inserts it into the div with the specified id.


Supported Platforms
 - BlackBerry OS 6.0+


Parameters
zoneId The Zone Id given to the developer by the BlackBerry Advertising Service on registration.
divId The id attribute of the div tag to which the banner will be inserted.
properties A set of options to further customize the advertising banner.

bannerTransitions: Sets the bannerTransitions property.
focusBorderColor: Sets the focusBorderColor property.
focusBorderWidth: Sets the focusBorderWidth property.
metadata: Sets the metadata property.
mmaSize: Sets the mmaSize property.
placeholder: Sets the placeholder property.
refreshRate: Sets the refreshRate property.

Code Example:
Include Advertising SDK JavaScript and API code into all the HTML pages as shown below:
Example 1:

<script type="text/javascript" src="http://www.blackberry.com/app_includes/asdk/adBanner.js"></script>
 
<center> <div id='bannerDiv'>     </div> </center>

<script type="text/javascript">
  //Adding Banner with default Banner properties
 var banner1 = new blackberry.advertising.Banner(31848, "bannerDiv");   
</script>
Example 2: 
<script type="text/javascript" src="http://www.blackberry.com/app_includes/asdk/adBanner.js"></script>
 
<center> <div id='bannerDiv'>     </div> </center>

<script type="text/javascript">
 //Adding Banner with custom Banner properties
 var banner1 = new blackberry.advertising.Banner(31848, "bannerDiv", {"bannerTransitions" : true,
                                                                "mmaSize" : "extralarge",
                                                                "focusBorderColor" : "blue",
                                                                "focusBorderWidth" : "2px",
                                                                "refreshRate" : 6000,
                                                                "placeholder" : "http://test.com/placeholder.jpg"},
                                                                "metadata": {"age" : "12",
                                                                             "gender" : "male",
                                                                             "city" : "SanFrancisco"}
                                                               };
</script>

Properties

Boolean bannerTransitions


Determines whether banner transitions will be enabled.


Supported Platforms
 - BlackBerry OS 6.0+


Default Value:

false


String focusBorderColor


Specifies the focus border colour of the Advertising Banner. Both RGB (ie #667766) and colour names (ie blue) are valid.


Supported Platforms
 - BlackBerry OS 6.0+


Default Value:

'blue'


String focusBorderWidth


Sets the border width of the banner when focused.


Supported Platforms
 - BlackBerry OS 6.0+


Default Value:

'2px'


JSON metadata


Specify the metadata (key/value pairs) for more targeted Advertisement.


Supported Platforms
 - BlackBerry OS 6.0+

String mmaSize


Specify the size of the banner. Should be one of;

  • "small"
  • "medium"
  • "large"
  • "extralarge"
  • "extraextralarge"
  • "auto"


Supported Platforms
 - BlackBerry OS 6.0+


Default Value:

"auto"


String placeholder


Set temporary place holder URL for the banner.


Supported Platforms
 - BlackBerry OS 6.0+

Number refreshRate


Set the banner refresh time in miliseconds. The timer cannot be set to less than 60000 ms.


Supported Platforms
 - BlackBerry OS 6.0+


Default Value:

60000


Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:02 GMT-0500 (EST)