Skip to content

Instantly share code, notes, and snippets.

@flurrydev
Last active August 29, 2015 14:06
Show Gist options
  • Save flurrydev/5177570d526f8009c785 to your computer and use it in GitHub Desktop.
Save flurrydev/5177570d526f8009c785 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.
*/
NSString *adSpaceName = @”BANNER_MAIN_VIEW”;
- (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:adSpaceName view:self.view viewController:self size:BANNER_BOTTOM];
}
-(void) viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
// It is recommended to not set ad delegate to nil or remove ad in the viewWillDisappear or
// viewDidDisappear method of the presenting view controller that is passed into
// fetchAndDisplayAdForSpace: and displayAdForSpace:onView:viewControllerForPresentation routines
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment