Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 99

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
04/21/14 07:43 PM (9 years ago)

iAd questions

Ok, here's a topic for you guys around the poker tables tonight at code camp... Please edit out any drunken tigers, call girls with missing limbs, and any losses over 50k when replying.... Ok, hell, don't do that... That would well be worth the topic change, lol... Anyway, back on track. I'm looking at integrating iAds for the first time, and there are various docs out there about it for dirrerent ways for different version. I know many 3.0 plugins have the switch build in, but if one I'm using do not, what are the steps to enable and display iAds in my self hosted project?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/21/14 08:45 PM (9 years ago)
Any self hosting software at 3.0 or so is going to be using the 'new' plugin format, which is the 'config_cp.txt' file over the old school index.php file. If the plugin doesn't accomodate for iAds, you may need to do one or all of the following: 1) Edit the 'config_cp.txt' file in the plugin directory (on the server) and add the following: {"fileType":"bt_section", "fileName":"btSection_ads.html"}, Make sure that it's 'in the middle' somewhere, to maintain json validity. This will provide the 'iAd' capability in the control panel. 'OR' you could just manually edit the json in the control panel for those you want ads in: "includeAds": "1", again, make sure it's in the middle to maintain json validity. 2) the plugin code will have to accomodate for it as well. This is usually added 'at the end' of your viewDidLoad method in the plugin.m file: //create adView? if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]){ [self createAdBannerView]; } and this will be added to your 'viewWillAppear' method in the same plugin.m file: //show adView? if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]){ [self showHideAdView]; } and… I think that should do it. On any other topics, what happens in Vegas, stays in Vegas (until I get there. then I want to hear every lascivious detail, with photo documentation if possible.) Cheers! -- Smug
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/22/14 02:38 PM (9 years ago)
Cool, sounds easy enough. Thanks Smug!
 

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.