Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 54

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
04/04/14 05:25 AM (10 years ago)

IAD & non IAD app, from single control panel entry - howto

This is useful in case anyone wants to publish 2 versions of an app, one with advertising and one with no advertising, managed from one CP app. This is not complicated, but in case anyone wants to do this I thought I'd share. IAD advertising is controlled for each plugin from the control panel. To over-ride, this is what I did: 1) I downloaded the app and created a duplicate build for the IAD version. 2) In xcode, open the build you want to modify and include IAD advertising 3) In the plugin where you want banner ads to appear, (e.g. BT_screen_customURL.m) search for "adView". You'll find two entries, one for //create adView? and one for // show adView? 4) All you need to do is comment out the 'If' test in both cases and advertising is forced to 'on' in the duplicate build. Example, 1st change here: //create adView? /* if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]){ [self createAdBannerView]; } */ // modified to bypass the control panel & force adview in this plugin [self createAdBannerView]; 2nd change here: //show adView? /* if([[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"includeAds" defaultValue:@"0"] isEqualToString:@"1"]){ [self showHideAdView]; } */ // modified to bypass the control panel & force adview in this plugin [self showHideAdView];
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
04/04/14 09:31 PM (10 years ago)
Thanks, Alan!
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
04/05/14 12:47 AM (10 years ago)
Thanks, code like this is always welcome.
 

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.