Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Advertising Service

Reply
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10
Accepted Solution

Advertising Service SDK Not Working

[ Edited ]

I want to add ads into my app, so I was just on this page:

https://bdsc.webapps.blackberry.com/html5/documentation/ww_services/system_requirements_1731666_11.h...

 

The system requriment's operating service only has Windows as supported. Does that mean developers on Mac can't integrate Advertising Services within their app? Do I need a Windows PC?

 

Thanks for any help

Wadi
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10

Re: Advertising Service SDK Not Working

[ Edited ]

I decided to test it on my own, but it didn't work in my app: no ads were being displayed.

So I tried making a simple app. You can see it's code below:

 

index.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="viewport"
	content="height=device-height,width=device-width,user-scalable=no" />
<style type="text/css">
   #bannertitle {color:#0A2788;font-weight:bold;}
   #bannerWrapperDiv {margin:0 auto;text-align:center;}
</style>
<script type="text/javascript" src="http://www.blackberry.com/app_includes/asdk/adBanner.js"></script>
<title>My Application Title</title>
</head>
   <body>
      <div id="bannerTitle">My Banner Application</div>
		<script type="text/javascript" >var bannerObj = new blackberry.advertising.Banner(107569, "ad_banner");</script>
      <div id="bannerWrapperDiv">
         <!-- The banner ad div element -->
         <div id="banner1">
            <!-- The banner ad space -->
         </div>
      </div>
   </body>
</html>

 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.0" rim:header="RIM-Widget: rim/widget">
    <name>Ad App</name> 
    <access subdomains="true" uri="http://www.blackberry.com/">
        <feature id="blackberry.advertising" required="true" version="1.0.0" /> 
    </access>
    <access subdomains="false" uri="*" /> 
    <content src="index.html" /> 
    <rim:loadingScreen foregroundImage="loader.gif" onRemotePageLoad="true" onLocalPageLoad="true" onFirstLaunch="true" /> 
</widget>

 Still no ads were being displayed. I added the Advertising API to the ext folder in the Webworks SDK folder.

 

Is there anything I'm missing?

I would really appreciated any help.

Wadi
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Advertising Service SDK Not Working

If you use the trial Zone ID (31848) does your application display the test ad? If so then it is likely that your application is created and working properly but no ads are being provided by the service yet.

Garett
@garettBeuk
--
Goodbye everybody!
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10

Re: Advertising Service SDK Not Working

Hi Garett,

Thank for getting back to me with this.
I just replaced the zone ID with 31848 and I still got nothing.

I'm not sure how to go about debugging this.
Wadi
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Advertising Service SDK Not Working

Are you testing on a real device or simulator? Does your test device have full data access to the Internet?

Garett
@garettBeuk
--
Goodbye everybody!
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10

Re: Advertising Service SDK Not Working

[ Edited ]

On a real device, and yes it has full data access.
Could it be related with me compiling the app on a Mac instead of Windows? (that's the only thing I can think of as to you it's not displaying any ads)

Wadi
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Advertising Service SDK Not Working

Mac vs Windows makes no difference, WebWorks is supported on both.

 

Could you pass the .ZIP file you are testing?

Garett
@garettBeuk
--
Goodbye everybody!
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10

Re: Advertising Service SDK Not Working

Please find the .zip file attached

Wadi
Retired
gbeukeboom
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10

Re: Advertising Service SDK Not Working

Hi Wadi,

 

I just noticed that the div ID used does not match the ID passed here:

var bannerObj = new blackberry.advertising.Banner(107569, "ad_banner");

 

While your div has the ID of banner1

 

Could you try fixing this to see if it helps?

Garett
@garettBeuk
--
Goodbye everybody!
Developer
wantoun
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10

Re: Advertising Service SDK Not Working

I just fixed that id thing, but I'm still getting no ads.

Do they take a long time before being shown? (I've tried leaving the app opened for more than 10minutes)

 

This is the index.html now:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" id="viewport"
	content="height=device-height,width=device-width,user-scalable=no" />
<style type="text/css">
   #bannertitle {color:#0A2788;font-weight:bold;}
   #bannerWrapperDiv {margin:0 auto;text-align:center;}
</style>
<script type="text/javascript" src="http://www.blackberry.com/app_includes/asdk/adBanner.js"></script>
<title>My Application Title</title>
</head>
   <body>
      <div id="bannerTitle">My Banner Application</div>
		<script type="text/javascript" >var bannerObj = new blackberry.advertising.Banner(31848, "ad_banner");</script>
      <div id="bannerWrapperDiv">
         <!-- The banner ad div element -->
         <div id="ad_banner">
            <!-- The banner ad space -->
         </div>
      </div>
   </body>
</html>

 

Wadi