Skip to content

Instantly share code, notes, and snippets.

@flurrydev
Created September 25, 2014 19:16
Show Gist options
  • Select an option

  • Save flurrydev/b6767f90b7233ff1b0ed to your computer and use it in GitHub Desktop.

Select an option

Save flurrydev/b6767f90b7233ff1b0ed to your computer and use it in GitHub Desktop.
@interface MyDelegateClass : NSObject <FlurryAdDelegate> {
// definitions
}
// MyDelegateClass.m
@implementation MyDelegateClass
-(void) init
{
[super init];
[FlurryAds setAdDelegate:self]; // Set the delegate
}
// Other code
- (void) spaceDidReceiveAd:(NSString*)adSpace
{
// Show the ad if desired
[FlurryAds displayAdForSpace:[self myAdSpace] onView:[self view]];
}
- (void) spaceDidFailToReceiveAd:(NSString*)adSpace error:(NSError *)error
{
// Handle failure to receive ad
}
- (BOOL) spaceShouldDisplay:(NSString*)adSpace interstitial:(BOOL)interstitial
{
// Decide if the Ad should be displayed
return true;
}
- (void) spaceDidFailToRender:(NSString *)space error:(NSError *)error
{
// Handle a failure to render the ad
}
- (void)spaceWillDismiss:(NSString *)adSpace
{
// Handle the user dismissing the ad
}
- (void)spaceDidDismiss:(NSString *)adSpace
{
// Handle the closing of the ad
}
- (void)spaceWillLeaveApplication:(NSString *)adSpace
{
// Handle the user leaving the application
}
- (void)videoDidFinish:(NSString *)adSpace
{
// Invoked only for rewarded ad spaces
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment