OAIAdManagerDelegate Protocol Reference
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. Sets the OAIAdManager's publisher ID.
- (NSString *)publisherId {
return @"PUBLISHERID";
}
REQUIRED. Sets the OAIAdManager's zone ID.
- (NSString*)getZone {
return @"ZONEID";
}
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. 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);
}
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);
}
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);
}
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);
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);
}
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);
}
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");
}
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);
}
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);
}
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);
}
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;
}
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);
}
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;
}
OPTIONAL. Loads the first request from a local cache representing the last successfully loaded ad network. Defaults to NO.
- (BOOL)runFirstRequestFromCache {
return YES;
}
OPTIONAL. If your app supports orientations other than portrait, always set the current orientation.
- (UIInterfaceOrientation)currentOrientation {
return [self interfaceOrientation];
}
OPTIONAL. Sets the style of the modal transition for Burstly ads (e.g. house ads). Defaults to UIModalTransitionStyleVertical
- (UIModalTransitionStyle)burstlyModalTransitionStyle {
return UIModalTransitionStyleVertical;
}
OPTIONAL. Used to transmit custom publisher targeting data key-value pairs back to the ad server.
- (NSString *)pubTargeting {
return @"gender='m',age=21";
}
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];
}