Interstitial Integration for iOS
Get up and running with the Interstitial Ad Unit in 4 easy steps:
- Implement the Delegate
- Initialize the Interstitial
- Check for Available Interstitial Ads
- Show an Interstitial
Before You Start
Make sure you have correctly integrated the Supersonic SDK into your application. Integration is outlined here.
Step 1. Implement the Delegate
The Supersonic SDK fires several events to inform you of ad availability. To receive these events, register to the delegate setISDelegate:isDelegate:
The SDK will notify your delegate of all possible events listed below:
@protocol SupersonicISDelegate <NSObject> @optional /** * Called when initiation process of the Interstitial products has finished successfully. **/ -(void)supersonicISInitSuccess; /** * Called each time an initiation stage fails, or if you have a problem in * the integration * You can learn about the reason by examining the 'error' value **/ -(void)supersonicISInitFailedWithError:(NSError *)error; /** * Called each time the Interstitial availability state has changed. When available value * is YES the next interstitial ad is ready to display, When receiving NO value make sure * you don't call the showInterstitial method. **/ -(void)supersonicISAdAvailable:(BOOL)available; /** * Called each time the Interstitial window has opened successfully. **/ -(void)supersonicISShowSuccess; /** * Called if showing the Interstitial for the user has failed. * You can learn about the reason by examining the ‘error’ value **/ -(void)supersonicISShowFailWithError:(NSError *)error; /** * Called each time the end user has clicked on the Interstitial ad. **/ -(void)supersonicISAdClicked; /** * Called each time the Interstitial window is about to close **/ -(void)supersonicISAdClosed;
Step 2. Initialize the Interstitial Ad Unit
Once you initialize the Interstitial Ad Unit, you will be able to call functions on it.
[[Supersonic sharedInstance] setISDelegate:YOUR_INTERSTITIAL_DELEGATE]; [[Supersonic sharedInstance] initISWithAppKey:APP_KEY withUserId:USER_ID];
Supersonic.sharedInstance().setISDelegate(YOUR_INTERSTITIAL_DELEGATE) Supersonic.sharedInstance().initISWithAppKey(APP_KEY, withUserId:USER_ID)
- APP_KEY is the unique ID of your Application in your Supersonic account.
- USER_ID is the unique ID of your end user. We support NSString from 1 to 64 characters. Common practice is to use the Apple Advertising ID (IDFA). More information on User IDs can be found here.
- For a full description of Interstitial events from the delegate, see Step 1.
Step 3. Check for Available Interstitial Ads
After you receive the supersonicISInitSuccess callback, with the Interstitial delegates implemented, you will also receive a notification when the ad is loaded and ready to serve with the supersonicISAdAvailable:(BOOL)available delegate.
Step 4. Show an Interstitial
Once you receive the supersonicISAdAvailable callback with a YES value, you are ready to show an Interstitial Ad to your users. Serve an interstitial to your users by calling the following method on your Supersonic instance:
[[Supersonic sharedInstance] showIS];
Done! You are now all set to deliver Interstitial Ads in your application.