Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 76    Views: 2580

tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
03/12/12 04:53 PM (12 years ago)

AdMob ads on iOS application!

Hi there BTers. Here is a small simple tutorial on how to monetize your app with AdMob. Before we begin there are some things that I should clarify: I came up with this hack when trying to add AdMob as a supplementary service to when iAd failed to show ads. Unfortunately I didn't succeeded in doing this (but I'm still trying). But I did manage to use AdMob as a complete substitute service. If you want to see it working live: - Download my app http://bit.ly/quizflamengo - Click on an ad, just to test it! ;-) - Rate my app! 5 star is enough, thanks! =D Why do you want to substitute iAds with AdMob? There's two reasons for that: - My target audience is in country that doesn't run iAds. - AdMob's fill rate is almost 100% while iAds hardly gets to 60-80% (depends on your country). What iOS versions and devices have you tested? - iPhone 3GS, 4 and 4S, no iPads were used to test this. - iOS 4.3 and 5.0 (there were some warnings) - It was only tested in Portrait mode, it wasn't tested in landscape mode. Is this going to work on Android? - Short answer: No! - Long answer: Definitely no! What do I need to use this on my app? - Mac, iPhone, Apple Developer account, AdMob account, Xcode. What abilities/skills do I need to do this? You need to be able to: - Read - Understand what you are reading - Read again before asking - Search Google - Copy and Paste - Typing If you can do all of the above keep reading... if not, press command (⌘) + w. Alright, lets get our hands dirty... ======================================== The boring part: 1. Setup an account on AdMob, create an App and write down the Publisher ID (GIYF). 2. Download the AdMob iOS SDK (https://developers.google.com/mobile-ads-sdk/download#downloadios) I'm using SDK 5.0.5 3. Incorporate the SDK into your Xcode Project (https://developers.google.com/mobile-ads-sdk/docs/ios/fundamentals) ======================================== The fun (?) part: 1. Open BT_viewController.h 1.1 import GADBannerView.h: //AdMob #import "GADBannerView.h" 1.2 On top of the line with /* iAd views */ add: //Admob GADBannerView *bannerView_; 2. Open the BT_viewController.m and scroll down or search for the method -(void)createAdBannerView 2.1 You need to comment (GIYF) or delete everything inside this method (void)createAdBannerView{ EVERYTHING INSIDE HERE SHOULD BE COMMENTED OR DELETED } 2.2 Replace the commented or deleted content with this one: //AdMob // Create a view of the standard size at the bottom of the screen. bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height -44, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; // Specify the ad's "unit identifier." This is your AdMob Publisher ID. bannerView_.adUnitID = @"XXXXXXXXXXXX"; // Let the runtime know which UIViewController to restore after taking // the user wherever the ad goes and add it to the view hierarchy. bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. [bannerView_ loadRequest:[GADRequest request]]; [bannerView_ release]; 2.3 Change the adUnitID with your Publisher ID (or else you wont get paid). 3. Go grab some champagne and celebrate your first step towards the App Galaxy!!! http://www.guidetotheappgalaxy.com/ Pretty difficult huh?! I really don't understand how this has never been done before. If it has been done before why haven't anyone shared this? I hope you enjoy this little hack and if you have any questions remember GIYF - Google Is Your Friend - but if Google is being a bad boy and won't help you let me know and I promise I'll try to be better than Google. If you have a suggestion on how to make this code even better or any additional info please let me know and I will update this post with your collaboration.
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 04:58 PM (12 years ago)
Looks pretty simple! Thanks for the share and I love to open your app and see the amazing pics and colors and the quiz is amazing! I will try and let you know how it works out.
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:01 PM (12 years ago)
Thanks Raoul!!! Let me know if you run into any problems. I think I covered everything but I might be forgetting something. I usually work on this things late at night and under a lot of caffeine! LOL
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
03/12/12 05:08 PM (12 years ago)
Great post!! I was just trying to implement another SDK and now the way you explained it I see how simple it is to use the adview code and replacing it with admob, as you have shown or any other for that matter. Cool!!
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:13 PM (12 years ago)
Exactly @mysps, we can use this hack to implement probably any other ad network we want. My next challenge is to use the didFailToReceiveAdWithError to show both iAd and AdMob (or any other). That's the ideal solution for an iOS app. I'm almost there, but not quite yet! Stay tuned...
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 05:14 PM (12 years ago)
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:24 PM (12 years ago)
Did you incorporated the AdMob sdk correctly? See https://developers.google.com/mobile-ads-sdk/docs/ios/fundamentals look at the "Incorporating the SDK" section. Make sure you have imported the GADBannerView.h into the BT_viewController.h file. Step 1.1 Make sure you have added the *bannerView_ type into the @interface in the BT_viewController.h file. Step 1.2 Let me know.
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 05:26 PM (12 years ago)
I added the correct codes in .h, I added SDK properly, but get that error, can you take a picture of your .m file so an see how the codes work?
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:31 PM (12 years ago)
I think I know what you did wrong... Did you delete the -(void)createAdBannerView ? You are not supposed to delete this part, just what is inside the curly brackets { }. Here's how the whole method should look like: //createAdBannerView -(void)createAdBannerView{ //AdMob // Create a view of the standard size at the bottom of the screen. bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height -44, //The -44 was added because of my layout you may need to change this. GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; // Specify the ad's "unit identifier." This is your AdMob Publisher ID. bannerView_.adUnitID = @"XXXXXXXXXXXXXXX"; // Let the runtime know which UIViewController to restore after taking // the user wherever the ad goes and add it to the view hierarchy. bannerView_.rootViewController = self; [self.view addSubview:bannerView_]; // Initiate a generic request to load it with an ad. [bannerView_ loadRequest:[GADRequest request]]; [bannerView_ release]; // Class classAdBannerView = NSClassFromString(@"ADBannerView"); // if(classAdBannerView != nil){ // [BT_debugger showIt:self:[NSString stringWithFormat:@"createiAdBannerView: %@", @""]]; // self.adView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease]; // self.adView.autoresizingMask = (UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth); // [self.adView setTag:94]; // self.adBannerView = [[[classAdBannerView alloc] initWithFrame:CGRectZero] autorelease]; // [self.adBannerView setDelegate:self]; // [self.adBannerView setTag:955]; // if(UIInterfaceOrientationIsLandscape([UIDevice currentDevice].orientation)) { // [adBannerView setCurrentContentSizeIdentifier: ADBannerContentSizeIdentifierLandscape]; // }else{ // [adBannerView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait]; // } // [self.adView setFrame:[BT_viewUtilities frameForAdView:self:screenData]]; // [adView setBackgroundColor:[UIColor clearColor]]; // [self.adView addSubview:self.adBannerView]; // [self.view addSubview:adView]; // [self.view bringSubviewToFront:adView]; // // } } Let me know if that worked.
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:35 PM (12 years ago)
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 05:45 PM (12 years ago)
I have the framework, but still get this error: ld: framework not found AudioUnit clang: error: linker command failed with exit code 1 (use -v to see invocation)
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:49 PM (12 years ago)
Have you followed step 3 of the "Incorporating the SDK" section of the "Google AdMob Ads iOS Fundamentals" tutorial? It seems like you are missing the AudioToolbox framework, wich is weird because I think its comes bundled by default with all BT projects. Could you share a screenshot of this error?
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:51 PM (12 years ago)
Oh oh, my bad... its not default on BT! You should add that framework on your project. Do you know how to do this? Look at the "Google AdMob Ads iOS Fundamentals" tutorial and try to figure out. If you can't figure out let me know and I'll walk you through it.
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 05:51 PM (12 years ago)
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 05:57 PM (12 years ago)
Weird, you have the AudioToolbox.framework Try clean (Product > Clean) and rebuild (Product > Build) to see if that solves the issue.
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 06:01 PM (12 years ago)
Oh I think I got it... Why do you have the AudioUnit framework, do you need it for something else?! Its not necessary for this hack. If you don't need it try deleting it, clean and run your project. I think its gonna work now!
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/12/12 06:02 PM (12 years ago)
Here's my frameworks (ignore the MobFox.framework) http://cl.ly/1T1o383B242H2S2K0P0c The GameKit.framework and CFNetwork.framework are for the Game Center integration. They aren't necessary for this hack.
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 06:16 PM (12 years ago)
I will try, can you email me at [email protected]
 
XboxMods
buzztouch Evangelist
Profile
Posts: 718
Reg: Oct 28, 2011
location unknow...
12,080
like
03/12/12 07:07 PM (12 years ago)
@tonycelestino Can you email me at [email protected] I put everything in, it ran, but no ad came up, i put my publisher ID in the correct area, still nothing...
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
03/13/12 01:42 PM (12 years ago)
Hey Raoul, I don't understand what do you want me to email you?!
 
tsdurai
Apple Fan
Profile
Posts: 66
Reg: Feb 20, 2012
Hyderabad
660
like
03/17/12 08:11 AM (12 years ago)
hi Tony Thanks for info.. We should add this hack once Apple approves our Applications ??
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
04/03/12 08:28 AM (12 years ago)
hi Tony i have to add this hack and don't have problem but i my banner don't show on screen on simulator this is picture i need your help pls Thank you ! http://bit.ly/HbGmKx http://bit.ly/H6h8cF
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
04/03/12 08:49 AM (12 years ago)
Hi @BW, try tweaking the CGRectMake... The second value "GAD_SIZE_320x50.height -44" is what determines the height of the banner view. I added this on an app without tabbars (that are 44px tall). I see that your app uses tabbars, try changing the "-44". Good luck!
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
04/03/12 04:57 PM (12 years ago)
hi Tony, Thank you so much, i have to change -120 and AdMob show on my screen now Thank you again !
 
sepala
Aspiring developer
Profile
Posts: 196
Reg: Nov 23, 2011
London
3,060
like
04/25/12 01:47 PM (11 years ago)
Brilliant guide! Thanks very much! One thing... I was getting an error coming up and building was failing because I had 2 curly brackets } at the end of the (void)createAdBannerView section. Deleted the second } and it all seems to work great now! I have a tabbed layout so get the ad banner to the correct height above the tabs I used -69 instead of -44 (or -120 that @Black White used above)
 
sepala
Aspiring developer
Profile
Posts: 196
Reg: Nov 23, 2011
London
3,060
like
04/25/12 01:59 PM (11 years ago)
Spoke too soon! Something weird is happening... I have a tabbed layout with nested menus (menu within menu within menu etc.) the banner is displaying correctly at the bottom of the first page of each tabbed menu (just above the tabs) but when I put the banner on subsequent menus it is half hidden behind the tabs...? Any ideas?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/26/12 08:05 AM (11 years ago)
Will the ads show in the simulator, or do I need to test directly on my handset to view results?
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/26/12 08:08 AM (11 years ago)
@Dragon007: yes it should show up from what I recall. I know it shows up 100% on the handset, I'm 99% confident that it shows up in the simulator as well.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/26/12 10:29 AM (11 years ago)
Can anyone help, my status in AdMob is showing red, not sure what I have done wrong as my integration of AdMob in my xcode project isn't showing any errors. Can anyone advise on what I may need to do.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/26/12 10:31 AM (11 years ago)
My ads will not show, I tried following the tutorial above which all seemed fine but no ads are showing.
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/26/12 10:33 AM (11 years ago)
Did you setup your ads in admob control panel?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/26/12 12:13 PM (11 years ago)
I think so, although I'm not 100% sure what you mean. Do I have to select the ads I want is that you mean? My status is red so I don't understand what could the reason for this, I'll check. Would the ads start showing when I add the admob framework?
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/26/12 12:16 PM (11 years ago)
Well yeah thats step 3, you have to add the framework for anything to work. I would start all over and follow the steps above. They work 100%.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/27/12 05:25 AM (11 years ago)
Hi Coderx I have been through the steps many times and I cannot seem to get the ads to appear. The guide above is very straight forward and simple to implement but I cannot get the ads to show up and I cannot see what I could be doing wrong.
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/27/12 06:39 AM (11 years ago)
If there are no errors and you have it setup in the admob control panel I dont see why you shouldn't see it.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/27/12 07:06 AM (11 years ago)
Yeah,that's what I thought; one question, do I have to create an ad pool of some sort in AdMob or should ads just appear once framework and code have been implemented?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/27/12 09:06 AM (11 years ago)
Another question,I'm a bit confused as many of the admob walk through video tutorials are only adding code to the viewcontroller.h, where as the guide mentioned above refers to adding code to both .h and .m files. Are both methods correct?
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/27/12 09:14 AM (11 years ago)
To be honest I never even looked at the video tutorial, just followed the instructions above and it works. Got a question for you... does it show in your admob account that there has been activity or is it red?
 
GaryContreras
Aspiring developer
Profile
Posts: 10
Reg: Jun 23, 2012
San Jose
3,950
like
06/27/12 03:49 PM (11 years ago)
Hi TonyCelestino. Looks like you are from Brazil..! I love that country Ive been in Curitiba once ;) Have you tried implementing AdWhirl ? That seems to be the Best Option out there (Owned by google now I believe) as an ad network mediator to serve ads from Admob, Aids, Millenial , and in house ads.. etc.. Let me know if you have any experience implementing that. I looking around on the forum about that as I believe it can help us all monetize the apps more effectively Regards.. Gary
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/29/12 07:21 AM (11 years ago)
Hi Coderx sorry for the late reply, in regards to your last post asking: Got a question for you... does it show in your admob account that there has been activity or is it red? Answer to this question is RED
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/29/12 07:28 AM (11 years ago)
@Dragon007 Thats ok.. you are still stuck on that component? I dont know what to tell you, why its not working. I dont think it should be red though after you set it up. It should be yellow with a acclamation mark. Maybe the admob part is not setup properly?
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
06/29/12 08:26 AM (11 years ago)
Would it have anything to do with the version of Xcode I'm using, which is the latest version 4.3.3. I don't get it either; I signed up to AdMob using my google account, I might try creating a new account the only issue is I saw if I delete any of the apps I won't be able to use the app name again, although I'm not sure if that applies to a new account.
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
06/29/12 08:29 AM (11 years ago)
@Dragon007 if you want, dropbox your project (clean, without admob) and I'll add the code portion in. All I need is the project and the proper key from admob that related to your app. Private message me with the link.
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/04/12 03:18 AM (11 years ago)
Hi, I have followed the directions in your awesome post. admob displays red banner BEHIND the menu. I've been trying everything to get the banner to display on on top of the menu section. Here is a screenshot of what I'm trying to explain - http://tinypic.com/r/30us86x/6 Can anyone please help me with this? I appreciate it! Thanks
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/04/12 04:31 AM (11 years ago)
Is that bt 1.4?
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/04/12 04:35 AM (11 years ago)
yes it is. thanks
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/04/12 04:58 AM (11 years ago)
Hmm. Haven't tried it myself on 1.4.
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/04/12 05:09 AM (11 years ago)
no thoughts at all on this issue?
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/04/12 05:18 AM (11 years ago)
I know that 1.4 is completely different than 2.0 and 1.5. I've honestly never played with 1.4, so I'm unsure. Sorry.
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/05/12 11:11 AM (11 years ago)
Thanks for your reply coderx. Have you ever come across this issue with 1.5 or 2 by any chance? And if so how would you go about fixing it? I know it may be a long shot but at this time I really can't find any solutions. Thanks!
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/05/12 11:13 AM (11 years ago)
No I haven't. I've even moved it around all over the place, never did I experience that. And moving it based on screen size doesnt help? If you changed the following code to where you want it? : bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height -44, //The -44 was added because of my layout you may need to change this. GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)];
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/05/12 11:18 AM (11 years ago)
Thanks I've got it set like that. Perhaps its just an simulator error. Is there a quick way I can test this on my iphone before I upload to the itunes store? If so, how can I do this? Thanks!
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/05/12 11:21 AM (11 years ago)
Try changing the code around? See if it will possibly pop out differently? Experiment. If you have a Dev account you can easily get it to your phone. Just have to setup the certificates for it. But thats another subject :)
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/05/12 11:23 AM (11 years ago)
Thanks I will try that. Yes also I do have a dev account. Is there a link you could possible provide to do that? Thanks
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/05/12 11:25 AM (11 years ago)
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/05/12 11:33 AM (11 years ago)
Thanks!
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
07/05/12 11:37 AM (11 years ago)
You welcome. Google around if you don't understand Apple's docs. Sometimes they tend to be more complicated than they have to be.
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/05/12 11:46 AM (11 years ago)
Thanks again for your help and input! :)
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/08/12 02:54 PM (11 years ago)
Good post, thank you
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
07/09/12 11:04 AM (11 years ago)
I see that on iPad the advertising that shows up is small, its the iPhone size. How can you have a big banner for iPad and small banner for iPhone? Thank you
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
07/20/12 10:39 AM (11 years ago)
hey i need some help, is anyone available
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/27/12 02:25 AM (11 years ago)
hello guys, i can't make the ads show up. i followed everything correctly and tried different stuff to make it work. im using sdk version 6.1.1
 
awesome123
Aspiring developer
Profile
Posts: 132
Reg: Dec 27, 2011
location unknow...
2,320
like
07/27/12 03:19 AM (11 years ago)
double post sorry
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/27/12 08:22 AM (11 years ago)
hi, if you just made a fresh ad unit with admob it usually takes 10 minutes or more for it to start appearing in your app. what version of buzztouch are you using?
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
07/27/12 08:37 AM (11 years ago)
Hi there guys! I've managed to create a hack to display iAd and when not available present AdMob. If you want to see it in action download this app - http://bit.ly/MbpiYx - I would appreciate if you rated it in the App Store, 5 stars is enough! ;) I'm sorry but I don't have time to build another tutorial right now, just wanted to show you guys that its possible and its not as hard as it may sound (if you do some research). Good hacking! =D
 
residual4life
Code is Art
Profile
Posts: 38
Reg: Sep 27, 2011
los angeles
380
like
07/27/12 12:50 PM (11 years ago)
wow thats a nice app, must of taken you a long time to do it.
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
07/28/12 08:09 AM (11 years ago)
@Residual4Life Thanks man. Yeah it took quite a while, but this is the 2nd version so I had some of the work already done! I would appreciate if you could rate it in the App Store. Thanks.
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
09/27/12 06:22 AM (11 years ago)
Great post, thanks TonyCelestino! It's working great. My setup is BT 2.0 with a tabbed layout, Xcode 4.5, AdMob SDK 6.1.4 and testing on an iPhone 4 with iOS 5.0.1. This are some extras thing that I had to do: 1- Add AudioToolbox Framework. 2- Changed "GAD_SIZE_320x50.height -44" for "-92". 3- It was working fine in the simulator but when I tried it in my iPhone got this error: ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /file/location for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation) To fix it (I know is not 100% the correct way) I simply toggled "Build Active Architecture Only" to "Yes" in the target's build settings. Now I am having some issues with the display of the ads (iAds or Admob) on my Customs Html Screens. The problem is that I cannot see the botton part of the screen because it's covered by the ad and I cannot keep scrolling. I guess it has to be some settings on BT_screen_customHTML.m but I couldn't figure it out. Does anybody knows how to fix it?
 
tonycelestino
Aspiring developer
Profile
Posts: 213
Reg: Jun 24, 2011
Maceio
4,080
like
09/27/12 06:31 AM (11 years ago)
Hey @AlmaR this happened to me also. Since I'm the one writing the HTML files all I did was insert a div with a bottom margin equal to the height of the banner on the footer of the HTML files. This little trick makes all the content visible. The real problem is when you are loading a HTML that you cant edit. The only feasible solution here would be to edit the size of the view at the m file. I've no idea how to do that because I never looked into it, but I think it shouldn't be too difficult. Let us know if you succeeded!
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
09/27/12 06:41 AM (11 years ago)
Thanks for your reply Tony! I can edit the HTML files but there are a lot so I prefer fixing the problem from the m file. If I find how to do it I will post it here.
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
10/10/12 02:59 PM (11 years ago)
@MadRod I fixed the iPad problem replacing this code: bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height -44, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; for this one: if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0.0, self.view.frame.size.height - GAD_SIZE_320x50.height -44, GAD_SIZE_320x50.width, GAD_SIZE_320x50.height)]; } else { bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(20, self.view.frame.size.height - GAD_SIZE_728x90.height -44, GAD_SIZE_728x90.width, GAD_SIZE_728x90.height)]; }
 
AlmaR
Lost but trying
Profile
Posts: 73
Reg: Jun 13, 2011
location unknow...
5,630
like
03/27/13 08:58 AM (11 years ago)
Hey guys! To implement this method using Xcode 4.6.1 and AdMob iOS SDK 6.3 you will also have to: 1- Use "-ObjC" instead of "-all_load" under Other Linker Flags (the boring part step#3) 2- Add AdSupport.framework. This is working perfect on iPhone & iPad in Portrait mode but it doesn't work on landscape mode. Any ideas?
 
franciscoWuLin
Aspiring developer
Profile
Posts: 23
Reg: Mar 15, 2013
Kaohsiung
8,680
like
04/29/13 12:50 AM (10 years ago)
Hi, I've followed the instructions to the best of my abilities, got rid of the red errors preventing the build, have double checked all these instructions, the build is successful, but I can't see any ads on either the simulator or the iphone. I've tried the banner example provided by Admob and it works correctly. Tried comparing the files where this code code goes in both projects, but they seem to treat the same thing with very different methods. Any advice on where to look for a solution? Thanks in advance! Francisco
 
franciscoWuLin
Aspiring developer
Profile
Posts: 23
Reg: Mar 15, 2013
Kaohsiung
8,680
like
04/29/13 06:04 AM (10 years ago)
It's working now, maybe I only had to wait. Tks for the info.
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
06/06/13 07:05 AM (10 years ago)
hi Tony, Now i want to change Interstitials Ads https://developers.google.com/mobile-ads-sdk/docs/admob/advanced, but i dont know about code it, pls help me i think many member want this tutorial too thank for your help! -Hoang http://www.blackwhite.vn
 
MadRod
Aspiring developer
Profile
Posts: 1853
Reg: Apr 12, 2012
Lisbon
27,930
like
09/16/13 05:42 AM (10 years ago)
Hey AlmaR, thanks for that. Ended up never seeing this post. Today was having the same problem. The solution worked. Cheers.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
03/09/14 09:39 AM (10 years ago)
Thanks Tony, got AdMobs working fine on my BT 3.0 IOS project...the above was easy and helpful! I added the above to BT_Plugins/bt_screen_menuSimple.m and the AdMob ads appear on every Simple Menu screen. I want specific adds to show on each of my MenuSimple screens. (I know I need to generate different bannerView_.adUnitID = @"XXXXXXXXXXXXXXX" for each Ad) I just don't know how to target these for different BT SimpleMenu screens. Thanks for any help
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.