Skip to content

Instantly share code, notes, and snippets.

@Bisera
Created May 7, 2014 00:28
Show Gist options
  • Save Bisera/8a48c331f9c13deb96b5 to your computer and use it in GitHub Desktop.
Save Bisera/8a48c331f9c13deb96b5 to your computer and use it in GitHub Desktop.
#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)viewDidAppear:(BOOL)animated {
[super viewDidAppear: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) viewDidDisappear:(BOOL)animated {
[super viewDidDisappear: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