webOS Nation Forums >  webOS apps and software >  webOS development > Admob???
Admob???

  Reply
 
LinkBack Thread Tools Display Modes
Old 02/15/2010, 07:41 PM   #1 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default Admob???

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
kdubhotsauce is offline   Reply With Quote
Old 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
Default

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)
mosdl is offline   Reply With Quote
Old 02/15/2010, 07:51 PM   #3 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default

Quote:
Originally Posted by mosdl View Post
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
Tried that, still doesn't work. Is there a javascript function i have to create?
kdubhotsauce is offline   Reply With Quote
Old 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
Default

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)
mosdl is offline   Reply With Quote
Old 02/15/2010, 11:01 PM   #5 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default

Quote:
Originally Posted by mosdl View Post
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.
HUH/ thanks for your help, but i dont understand one bit, do you think you could possibly post the code Thanks!
kdubhotsauce is offline   Reply With Quote
Old 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
Default

The website you link to has 3 code snippets.

You want to add
Code:
{"source": "app\/utils\/admob.js"},
to your sources.json file

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),
    
        });
pub_id: 'YourPubId' - replace YourPubId with the id admob gave you

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)
mosdl is offline   Reply With Quote
Old 02/15/2010, 11:20 PM   #7 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default

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.
kdubhotsauce is offline   Reply With Quote
Old 02/15/2010, 11:29 PM   #8 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default

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),
    
        });

}
kdubhotsauce is offline   Reply With Quote
Old 02/15/2010, 11:46 PM   #9 (permalink)
Member
 
kdubhotsauce's Avatar
 
Join Date: Feb 2009
Location: La Mirada, California
Posts: 102
Likes Received: 2
Thanks: 22
Thanked 20 Times in 13 Posts
Default

im starting to think its ares thats not letting me do it...
kdubhotsauce is offline   Reply With Quote
Old 02/16/2010, 04:42 PM   #10 (permalink)
Member
 
Join Date: Jan 2010
Posts: 115
Likes Received: 0
Thanks: 7
Thanked 24 Times in 17 Posts
Default did you...

did you change:

Code:
My pubid #
to your pubid number in the code? if not it obviously won't work...
jdforsythe is offline   Reply With Quote
Old 04/04/2010, 11:18 PM   #11 (permalink)
Member
 
franky_402's Avatar
 
Join Date: Aug 2009
Location: Ottawa, IL
Posts: 251
Likes Received: 0
Thanks: 12
Thanked 21 Times in 13 Posts
Default

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
franky_402 is offline   Reply With Quote
Old 12/05/2010, 09:42 PM   #12 (permalink)
Member
 
rothoof's Avatar
 
Join Date: Jul 2009
Location: Southeast Kansas
Posts: 509
Likes Received: 1
Thanks: 57
Thanked 48 Times in 30 Posts
Default

Quote:
Originally Posted by kdubhotsauce View Post
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),
    
        });

}

Is "Main-assistant.js need to be added to you app files or is it the main scene of your app?
rothoof is offline   Reply With Quote
Reply

 

Tags
admob, ads, app, ares

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0