02/15/2010, 07:41 PM
|
#1 (permalink) |
|
Member
![]() ![]() Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
|
I really need help cause i cant get these ads to work and its driving me crazy! I'm not too developer savvy and therefore using ares to make my app. I want to put admob ads on my app. I already have an account, publisher id and etc and i know the code they posted up on Google code. However, i just i cant get it to work! Can someone PLEASE HELP ME or even if you give me the code. I only have the stage-assistant and the main assistant so the ads would go in the Main-Assistant! SOMEONE PLEASE HELp!
IntegrationDocumentation - admob-webos - Developer documentation - Project Hosting on Google Code |
02/15/2010, 07:45 PM
|
#2 (permalink) |
|
Member
![]() ![]() Join Date: Jun 2009
Location: Silicon Valley
Posts: 787
Likes Received: 30
Thanks: 3
Thanked 102 Times in 67 Posts
|
Try this:
Under apps, create a new dir called say "utils", and put the admob.js file in there. Then follow the directions on the google code page
__________________
Apps: MyQ for Netflix (Phone/TouchPad), Giantbomb (Phone), Excavate (Reddit/Digg clients for TouchPad) |
02/15/2010, 09:45 PM
|
#4 (permalink) |
|
Member
![]() ![]() Join Date: Jun 2009
Location: Silicon Valley
Posts: 787
Likes Received: 30
Thanks: 3
Thanked 102 Times in 67 Posts
|
In your main assistant.js file, you need to include the code marked "In your main scene first initialize AdMob with: " in the setup() function.
In the same setup file you want to copy the other code as well and change "YourPubId-bottom-ad-position" to be an id of the element in the main scene you want to become the ad.
__________________
Apps: MyQ for Netflix (Phone/TouchPad), Giantbomb (Phone), Excavate (Reddit/Digg clients for TouchPad) |
02/15/2010, 11:01 PM
|
#5 (permalink) | |
|
Member
![]() ![]() Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
|
Quote:
|
|
02/15/2010, 11:12 PM
|
#6 (permalink) |
|
Member
![]() ![]() Join Date: Jun 2009
Location: Silicon Valley
Posts: 787
Likes Received: 30
Thanks: 3
Thanked 102 Times in 67 Posts
|
The website you link to has 3 code snippets.
You want to add Code:
{"source": "app\/utils\/admob.js"},
In your mainassistant.js file: Code:
AdMob.ad.initialize({
pub_id: 'YourPubId', // your publisher id
bg_color: '#ccc', // optional background color, defaults to #fff
text_color: '#333', // optional background color, defaults to #000
test_mode: true // optional, set to true for testing ads, remove or set to false for production
});
AdMob.ad.request({
onSuccess: (function (ad) { // successful ad call, parameter 'ad' is the html markup for the ad
this.controller.get('admob_ad').insert(ad); // place mark up in the the previously declared div
}).bind(this),
onFailure: (function () { // no ad was returned or call was unsuccessful
// do nothing?
}).bind(this),
});
You also need to add to main-scene.html this code: <div id="admob_ad"></div> This will become your ad code
__________________
Apps: MyQ for Netflix (Phone/TouchPad), Giantbomb (Phone), Excavate (Reddit/Digg clients for TouchPad) |
02/15/2010, 11:20 PM
|
#7 (permalink) |
|
Member
![]() ![]() Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
|
WOW, i seriously must suck at this cause i still am not getting it to work. i've got everything except the main assistant part. it keeps crashing my app (white screen) do you think you could possibly write the whole main-assistant or is taht and i am actually making an error and theres nothing left. I really appreciated this btw.
|
02/15/2010, 11:29 PM
|
#8 (permalink) |
|
Member
![]() ![]() Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
|
Im not sure if i did this right cause it still aint working but atleast my app isn't crashing
Code:
MainAssistant.prototype.setup = function() { AdMob.ad.initialize({
pub_id: 'My pubid #', // your publisher id
bg_color: '#ccc', // optional background color, defaults to #fff
text_color: '#333', // optional background color, defaults to #000
test_mode: true // optional, set to true for testing ads, remove or set to false for production
});
AdMob.ad.request({
onSuccess: (function (ad) { // successful ad call, parameter 'ad' is the html markup for the ad
this.controller.get('admob_ad').insert(ad); // place mark up in the the previously declared div
}).bind(this),
onFailure: (function () { // no ad was returned or call was unsuccessful
// do nothing?
}).bind(this),
});
}
|
04/04/2010, 11:18 PM
|
#11 (permalink) |
|
Member
![]() ![]() Join Date: Aug 2009
Location: Ottawa, IL
Posts: 251
Likes Received: 0
Thanks: 12
Thanked 21 Times in 13 Posts
|
BUMP
I am also having problems with this, i have learned that alot of functions do not work right in ares and things are slightly changed which causes an entire app to crash. really frustrating when you actually research how to do something but all instructions are for the mojo sdk and dont work in ares. shouldnt palm have made them work together not separately? I cant get it to work either, ive tried alot of different things so far.
__________________
i1000+ -> i90 -> i530 -> i730 -> i530 -> i730 -> i560 -> i930 -> i215 -> i860 -> i930 -> i860 -> i870 -> i880 -> i870 -> i850 -> i870 -> i830 -> i9 -> Pre |
12/05/2010, 09:42 PM
|
#12 (permalink) | |
|
Member
![]() Join Date: Jul 2009
Location: Southeast Kansas
Posts: 509
Likes Received: 1
Thanks: 57
Thanked 48 Times in 30 Posts
|
Quote:
Is "Main-assistant.js need to be added to you app files or is it the main scene of your app? |
|
![]() |
|
| Tags |
| admob, ads, app, ares |
| Thread Tools | |
| Display Modes | |
|
|



