OAIAdManagerDelegate Protocol Reference

Overview

The OAIAdManagerDelegate protocol defines a set of optional and required methods you can use to configure OAIAdManager objects and to receive ad-serving related messages for OAIAdManager objects.

Required Instance Methods
publisherId

REQUIRED. Sets the OAIAdManager's publisher ID.

- (NSString *)publisherId {
    return @"PUBLISHERID";
}
getZone

REQUIRED. Sets the OAIAdManager's zone ID.

- (NSString*)getZone {
    return @"ZONEID";
}
viewControllerForModalPresentation

REQUIRED. Sets the UIViewController the OAIAdManager should use for full-screen rollouts (e.g. for interstitial ads and for UIWebView rollouts after banner ad taps). Must be the top-most UIViewController in your stack.

- (UIViewController *)viewControllerForModalPresentation {
    return self;
}
Optional Instance Methods
adManager:viewDidChangeSize:fromOldSize:

OPTIONAL. Called when the OAIAdManager’s view changes size. Used to ensure that the app's UI adapts to the ad content size.

- (void)adManager:(OAIAdManager*)manager viewDidChangeSize:(CGSize)newSize fromOldSize:(CGSize)oldSize {
    NSLog(@"adManager:%p changed view size from %fx%x to %fx%f", manager, oldSize.width, oldSize.height, newSize.width, newSize.height);
}
adManager:attemptingToLoad:

OPTIONAL. Called when the OAIAdManager is attempting to load an ad network via a precacheAd or requestRefreshAd call.

- (void)adManager:(OAIAdManager*)manager attemptingToLoad:(NSString*)aNetwork {
    NSLog(@"adManager:%p attempting to load ad network %@", manager, aNetwork);
}
adManager:adNetworkWasClicked:(NSString*)aNetwork:

OPTIONAL. Called when an ad was clicked by the user.

- (void)adManager:(OAIAdManager*)manager adNetworkWasClicked:(NSString*)aNetwork {
    NSLog(@"adManager:%p an ad was clicked for ad network %@", manager, aNetwork);
}
adManager:adNetworkControllerPresentFullScreen:

OPTIONAL. Called when the OAIAdManager is going to present a full-screen ad (either due to an automatic interstitial rollout or a user click).

- (void)adManager:(OAIAdManager*)manager adNetworkControllerPresentFullScreen:(NSString*)aNetwork {
    NSLog(@"adManager:%p presented full screen for ad network %@", manager, aNetwork);
adManager:adNetworkControllerDismissFullScreen:

OPTIONAL. Called when the OAIAdManager is dismissing a full-screen ad.

- (void)adManager:(OAIAdManager*)manager adNetworkControllerDismissFullScreen:(NSString*)aNetwork {
    NSLog(@"adManager:%p dismissed full screen for ad network %@", manager, aNetwork);
}
adManager:didLoad:

OPTIONAL. Called when the OAIAdManager successfully loads an ad network via a requestRefreshAd or preached call.

- (void)adManager:(OAIAdManager*)manager didLoad:(NSString*)aNetwork {
    NSLog(@"adManager:%p loaded ad network %@", manager, aNetwork);
}
adManager:didLoad:isInterstitial:

OPTIONAL. Called when the OAIAdManager successfully loads an ad network via a requestRefreshAd call. isInterstitial is YES if the ad presents a full-screen rollout automatically.

- (void)adManager:(OAIAdManager*)manager didLoad:(NSString*)aNetwork isInterstitial:(BOOL)isInterstitial{
    NSLog(@"adManager:%p loaded ad network %@ and it is%@ an interstitial", manager, aNetwork, isInterstitial ? @"", @" not");
}
adManager:failedToLoad:

OPTIONAL. Called when the OAIAdManager fails to load an ad network via a precacheAd or requestRefreshAd call.

- (void)adManager:(OAIAdManager*)manager failedToLoad:(NSString*)aNetwork {
    NSLog(@"adManager:%p failed to load ad network %@", manager, aNetwork);
}
adManager:requestThrottled:

OPTIONAL. Called when the OAIAdManager throttles an ad request (i.e., a call to requestRefreshAd).

- (void)adManager:(OAIAdManager*)manager requestThrottled:(NSNumber*)time {
    NSLog(@"adManager:%p throttled ad request, manager);
}
adManager:didPrecacheAd:

OPTIONAL. Called when the OAIAdManager successfully precaches an ad via a precacheAd call.

- (void)adManager:(OAIAdManager*)manager didPrecacheAd:(NSString*)aNetwork {
    NSLog(@"adManager:%p precached an ad from ad network %@", manager, aNetwork);
}
burstlyAnchor

OPTIONAL. Instructs the OAIAdManager at which point of its ad view it should anchor. Defaults to Anchor_Top | Anchor_Left.

- (Anchor)burstlyAnchor {
    return Anchor_Bottom;
}
burstlyAnchorPoint

OPTIONAL. Instructs the OAIAdManager where in the superView to anchor its ad view. Defaults to (0, 0).

- (CGPoint)burstlyAnchorPoint {
    return CGPointMake(self.view.bounds.size.width/2, self.view.bounds.size.height);
}
defaultSessionLife

OPTIONAL. Returns the default rollover time for ads. This can be overridden server side for ad network ads but not for house/direct ads.

- (CGFloat)defaultSessionLife {
    return 20.0f;
}
runFirstRequestFromCache

OPTIONAL. Loads the first request from a local cache representing the last successfully loaded ad network. Defaults to NO.

- (BOOL)runFirstRequestFromCache {
    return YES;
}
currentOrientation

OPTIONAL. If your app supports orientations other than portrait, always set the current orientation.

- (UIInterfaceOrientation)currentOrientation {
    return [self interfaceOrientation];
}
burstlyModalTransitionStyle

OPTIONAL. Sets the style of the modal transition for Burstly ads (e.g. house ads). Defaults to UIModalTransitionStyleVertical

- (UIModalTransitionStyle)burstlyModalTransitionStyle {
    return UIModalTransitionStyleVertical;
}
pubTargeting

OPTIONAL. Used to transmit custom publisher targeting data key-value pairs back to the ad server.

- (NSString *)pubTargeting {
    return @"gender='m',age=21";
}
crParms

OPTIONAL. Used to transmit custom creative-specific data key-value pairs to customize landing page URLs back to the ad server.

- (NSString *)crParms {
    return [NSString stringWithFormat:@"udid='%@'", [UIDevice currentDevice].uniqueIdentifier];
}