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: Sun Dec 30 2012 13:31:15 GMT-0500 (EST)
Supported Platform(s)
- BlackBerry OS 6.0+
API | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
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 ID | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
<feature id="blackberry.advertising" /> | Y | Y |
Permission Elements (PlayBook Only) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
API Summary
Constructors
blackberry.advertising.Banner
blackberry.advertising.Banner (zoneId : Number, divId : String, [properties: JSON]) |
Supported Platform(s)
- BlackBerry OS 6.0+Description
Creates a new Banner Object with the given properties and automatically inserts it into the div with the specified id.
Parameter | Type | Description |
---|---|---|
zoneId | Number | The Zone Id given to the developer by the BlackBerry Advertising Service on registration. |
divId | String | The id attribute of the div tag to which the banner will be inserted. |
properties |
JSON
Optional |
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(s)
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:
Property | Type | Description | Supported Platform(s) |
---|---|---|---|
bannerTransitions default: false | Boolean |
Determines whether banner transitions will be enabled.
|
- BlackBerry OS 6.0+
|
focusBorderColor default: 'blue' | String |
Specifies the focus border colour of the Advertising Banner. Both RGB (ie #667766) and colour names (ie blue) are valid.
|
- BlackBerry OS 6.0+
|
focusBorderWidth default: '2px' | String |
Sets the border width of the banner when focused.
|
- BlackBerry OS 6.0+
|
metadata | JSON |
Specify the metadata (key/value pairs) for more targeted Advertisement.
|
- BlackBerry OS 6.0+
|
mmaSize default: "auto" | String |
Specify the size of the banner. Should be one of;
|
- BlackBerry OS 6.0+
|
placeholder | String |
Set temporary place holder URL for the banner.
|
- BlackBerry OS 6.0+
|
refreshRate default: 60000 | Number |
Set the banner refresh time in miliseconds. The timer cannot be set to less than 60000 ms.
|
- BlackBerry OS 6.0+
|
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 13:31:15 GMT-0500 (EST)