Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 1    Views: 370

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
12/11/12 01:28 PM (13 years ago)

removing adds with in app purchase plugin

Can someone help me with the code necessary to remove ads from an app using the Easy In-App Purchase plugin? I asked the question a while back in the thread: http://www.buzztouch.com/forum/thread.php?tid=F52BDFEE951DCB05E7F789E&fid=BC70C36A743CD4FAD95D17F&sortColumn=FT.id&sortUpDown=DESC&currentPage=3 But it seems to be lost to oblivion. I understand I need to create an object and check for it in the BT_viewcontroller.m file. I assume it's as easy as calling an if/then statement right before the "-(void)createAdBannerView{" line, and including that method if the object is set to a certain value. So, would something like this work? In the "Easy_in_app_purchase.m" file: change the section on completing the transaction to: // // called when the transaction was successful // - (void)completeTransaction:(SKPaymentTransaction *)transaction{ [BT_debugger showIt:self:@"completeTransaction"]; [self provideContent:transaction.payment.productIdentifier]; [self finishTransaction:transaction wasSuccessful:YES]; //save this in the prefs so we know this productID was purchased by this device... [BT_strings setPrefString:[NSString stringWithFormat:@"purchased_%@", productID]:productID]; //new code entered here for removing ads: [BT_strings setPrefString:[NSString stringWithFormat:@"adsremoved"]: @"TRUE"]; } And change the "BT_viewcontroller.m" file section on "Create Ad Banner View" to: //createAdBannerView //new code: NSString *checkAds = [BT_strings getPrefString:[NSString stringWithFormat:@"adsremoved"]]; if (checkAds == @"TRUE"){ //old code: -(void)createAdBannerView{ 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]; } } }
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/11/13 10:32 PM (12 years ago)
Isn't this a feature now? Or I could have sworn a guide was released for this exact functionality, I know a ton of people kept requesting it. David https://buzztouchmods.com/market
 

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.