Warning: is_writable(): open_basedir restriction in effect. File(/var/www/clients/client2/web93/web/wp-content/uploads/broken-link-checker/blc-log.txt) is not within the allowed path(s): (/var/www/clients/client1/web15/web:/var/www/clients/client1/web15/private:/var/www/clients/client1/web15/tmp:/var/www/supersonic-knowledge.rtl.co.il/web:/srv/www/supersonic-knowledge.rtl.co.il/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client1/web15/web/wp-content/plugins/broken-link-checker/core/init.php on line 141
Interstitial Integration for iOS - Supersonic Knowledge Center

Interstitial Integration for iOS

Get up and running with the Interstitial Ad Unit in 4 easy steps:

  1. Implement the Delegate
  2. Initialize the Interstitial
  3. Check for Available Interstitial Ads
  4. 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:

OBJECTIVE-C
(void)setISDelegate:(id<SupersonicISDelegate>) isDelegate;

SWIFT

#Erez Swift

Note: Do not assume the callbacks are always running on the main thread. Any UI interaction/updates resulting from Supersonic callbacks need to be passed to the main main thread before executing.

The SDK will notify your delegate of all possible events listed below:

OBJECTIVE-C
@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;

SWIFT

#Erez Swift

Step 2. Initialize the Interstitial Ad Unit

Once you initialize the Interstitial Ad Unit, you will be able to call functions on it.

OBJECTIVE-C
[[Supersonic sharedInstance] setISDelegate:YOUR_INTERSTITIAL_DELEGATE];
[[Supersonic sharedInstance] initISWithAppKey:APP_KEY withUserId:USER_ID];

SWIFT

Supersonic.sharedInstance().setISDelegate(YOUR_INTERSTITIAL_DELEGATE)
Supersonic.sharedInstance().initISWithAppKey(APP_KEY, withUserId:USER_ID)

Note:

  • APP_KEY is the unique ID of your Application in your Supersonic account.
    Supersonic Application Key
  • 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.

OBJECTIVE-C
supersonicISAdAvailable:(BOOL)hasAvailableAds;

SWIFT

func supersonicISAdAvailable(hasAvailableAds:Bool)

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:

OBJECTIVE-C
[[Supersonic sharedInstance] showIS];

SWIFT

Supersonic.sharedInstance().showIS()

 

Done! You are now all set to deliver Interstitial Ads in your application.



What’s Next?
Follow our integration guides to implement additional Ad Units: