Discussion Forums  >  Suggestions, Ideas, Wish List

Replies: 5    Views: 120

Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
04/02/12 10:23 PM (13 years ago)

iAdMob on App BT source

i have make some app and approved but i don't know how to add iAdMob to BT source code can BT team tip's how turn on and iAdMob on BT source ? thank you so much
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
04/03/12 06:17 AM (13 years ago)
how i can put my Publisher ID on BT source code ?
 
Black White
I hate code!
Profile
Posts: 292
Reg: Feb 22, 2012
hanoi
4,770
like
04/04/12 07:45 AM (13 years ago)
problem solved ! this is tip's from Tony Good luck ! 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: 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]; // // } } 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.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
03/07/14 10:01 AM (11 years ago)
Hopefully this is easy for someone.... i have AdMob ads working in my BT 3.0 IOS project...the above was easy and helpful. I added the above to my BT_viewController.m file, and the AdMob ads appear on every screen. What screens do I need to add the above to, in order to add specific ads, to specific screens in my app? 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.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
03/07/14 10:11 AM (11 years ago)
Ooops...forgot to say thanks for the above!
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
03/07/14 10:23 AM (11 years ago)
OK, so I figured out how to ONLY make the ads appear on the simple list menus: I added it here: BT_Plugins/bt_screen_menuSimple.m instead of here: BT_Layout/BT_viewController.m So now the question, how do I use different AdMobs ads for my different Simple List menu 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.