Skip to content

Instantly share code, notes, and snippets.

@flurrydev
Last active December 17, 2015 23:09
Show Gist options
  • Save flurrydev/5687235 to your computer and use it in GitHub Desktop.
Save flurrydev/5687235 to your computer and use it in GitHub Desktop.
Display Banner Ads with Flurry AppSpot
#import "FlurryAdDelegate.h"
#import "FlurryAds.h"
/**
* Banners can be displayed with a single method. Here we will show how you
* would display banners when a view appears and remove it when the view
* disappears.
*/
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// Optional step: Register yourself as a delegate for ad callbacks
[FlurryAds setAdDelegate:self];
// Fetch and display banner ad for a given ad space. Note: Choose an adspace name that
// will uniquely identifiy the ad's placement within your app
[FlurryAds fetchAndDisplayAdForSpace:@"BANNER_MAIN_VIEW" view:self.view size:BANNER_BOTTOM];
}
-(void) viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// Remove the ad when view dissappears
[FlurryAds removeAdFromSpace:@"BANNER_MAIN_VIEW"];
// Reset delegate, if set earlier
[FlurryAds setAdDelegate:nil];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment