Follow

iOS SDK Integration Version 2.38.1

Requirements

  • iOS Version 7.0+
  • Xcode 6+

 

 

Step 1: Integrating the SDK


AerServ offers 2 options for integration:

1-1. CocoaPods

1-2. Static Integration

 

Step 2: Initializing AerServSDK


This is a recommended step to do before loading any ads. Initializing AerServSDK will update server-side configurations and additionally initialize any mediated ad sources.

Within the AerServ dashboard, click on the inventory tab and edit the specific application that is being integrated. There will be an App ID associated to that application. Use that App ID to call AerServSDK's initializeWithAppID: in the early phases of the application. Suggested place to kick off the initialization process is in the application's AppDelegate inside the application:didFinishLaunchingWithOptions: method.

#import <AerServSDK/AerServSDK.h>
...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    ...
    // initialize AerServSDK with an App ID
    [AerServSDK initializeWithAppID:@"1000473"]; // replace 1000473 with your appliciation's App ID
    ...
    return YES;
}

 

Step 3: Display Banner Ads


Create an ASAdView object by passing in a placement setup on the AerServ dashboard as well as the banner's size. Refer to ASAdView.h for AerServSDK's predefined sizes.

#import <AerServSDK/AerServSDK.h>
...
ASAdView *asAdView = [ASAdView viewWithPlacementID:@"1000834" andAdSize:ASBannerSize];

 

Add the ASAdView object to your application's view.

[self.view addSubview:asAdView];

 

In the view controller that the ASAdView object is added to, make sure that the view controller adheres to the ASAdViewDelegate protocol. Additionally, add the callback viewControllerForPresentingModalView that will return itself.

@interface ViewController() <ASAdViewDelegate>
...
- (UIViewController*)viewControllerForPresentingModalView {
    return self;
}

 

Lastly, kick off the ad request by loading the ad.

[asAdView loadAd];

 

Additional Banner Callbacks

Please refer to ASAdView.h for all available callbacks and descriptions of each. Settings for supplying ad targeting key words, defining the ad request timeout, specifying the banner refresh time interval, preloading, and more can be found in the ASAdView header as well.

 

Step 4: Displaying Interstitial Ads


Create an ASInterstitialViewController object with a placement setup on the AerServ dashboard and a delegate that conforms to ASInterstitialViewControllerDelegate.

#import <AerServSDK/AerServSDK.h>
...
@interface ViewController() <ASInterstitialViewControllerDelegate>

@property (nonatomic, strong) ASInterstitialViewController *asInterstitialVC;
...
self.asInterstitialVC = [ASInterstitialViewController viewControllerForPlacementID:@"1000741" withDelegate:self];

 

Start the ad request by loading an ad with your specified settings.

[self.asInterstitialVC loadAd];

 

When the ad is ready, you can display it from a parent view controller.

if(self.asInterstitialVC.isReady)
	[self.asInterstitialVC showFromViewController:aViewController];

 

Alternatively, instead of constantly checking if the ad is ready, a callback event can be listened to before showing the ad.

- (void)interstitialViewControllerAdLoadedSuccessfully:(ASInterstitialViewController *)viewController {
	[viewController showFromViewController:aViewController];
}

 

Optional Interstitial Steps

Preloading Interstitial Ads 

Additional Interstitial Callbacks 

Please refer to ASInterstitialViewController.h for all available callbacks and descriptions for each. Settings for supplying ad targeting key words, defining the ad request timeout, video player controls, and more can be found in the ASInterstitialViewController header as well.

 

Additional Settings


Pausing & Resuming Video Ads

Virtual Currency

Ad Transaction Information

Adding Keyword Tagging

Adding Publisher Keys

Enabling Geolocation Targeting

Disabling App Transport Security for iOS 9

 

Version History


View iOS Version History

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk