04-18-2012 03:34 AM - edited 04-18-2012 05:17 PM
I want to add ads into my app, so I was just on this page:
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
Solved! Go to Solution.
04-18-2012 04:39 PM - edited 04-18-2012 05:17 PM
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/adBann er.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.
04-27-2012 10:45 AM
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.
04-28-2012 02:11 AM
04-30-2012 09:48 AM
Are you testing on a real device or simulator? Does your test device have full data access to the Internet?
04-30-2012 09:50 AM - edited 04-30-2012 09:51 AM
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)
04-30-2012 09:54 AM
Mac vs Windows makes no difference, WebWorks is supported on both.
Could you pass the .ZIP file you are testing?
04-30-2012 02:38 PM
Please find the .zip file attached
04-30-2012 03:56 PM
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?
05-01-2012 02:34 AM
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/adBann er.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>