Update to the Latest ironSource iOS SDK

We’re excited to introduce the ironSource SDK 6.5+, with brand new features and significant enhancements. Following the SDK release, existing integrations of earlier SDK versions are outdated.Follow this guide to upgrade from earlier SDK versions to the latest ironSource SDK.

Step 1. Replace Supersonic.framework with the Latest SDK

Cocoapods

  • Replace Supersonic with ironSource in your podfile
    • Replace pod ‘SupersonicSDK’,’~>6.4.xx’ with the following
      pod 'IronSourceSDK','8.0.0.0'
      pod 'IronSourceAdQualitySDK','7.19.0'
      
    • Run a pod update

Manual Download

ironSource Mediation Demo App

The Integration Demo application demonstrate how to integrate the ironSource Mediation in your app.
Download iOS Demo Application

Step 2. Replace Supersonic Import & Instance

  • Remove the Supersonic import from your code.
    Replace this line of code:
    #import "Supersonic/Supersonic.h"

    With this:

     #import <IronSource/IronSource.h>
  • Remove the Supersonic instance from your application start.
    [Supersonic sharedInstance];

Step 3. Update SDK Methods

We’ve standardized and updated all of our methods according to tech conventions, and replaced all Supersonic mentions with ironSource. Further, you can now fetch ads with a single init [called at …]. You’ll need to review and replace existing methods. You can easily find the new methods in your Header files. In addition, you can find them mapped out in the SDK Methods & Delegates article.

Find them mapped below:

General Methods (Relevant for All Ad Units)

  • New! SetuserID
    The UserID is a unique identifier for each user. You can set the userID parameter, or let us generate one for you. If you’re serving the Offerwall ad unit or server-to-server callbacks to reward your users with our rewarded ad units, you must set the UserID. Common practice is to use the Apple IDFV (Identifier for Vendor).
    [IronSource setUserId:@"UserID"];
  • AdvertisingID
    [IronSource advertiserId];
  • Ad Unit Initialization
    You can initialize the SDK in two ways. We recommend the first method as it will fetch the specific ad units you define.
    • Init the specific ad units mentioned in the adUnits parameter, preferably on appstart:
       [IronSource initWithAppKey:APPKEY adUnits:@[IS_REWARDED_VIDEO,IS_INTERSTITIAL,IS_OFFERWALL]];
    • Init the ad units you’ve configured on the ironSource platform through the SDK:
      [IronSource initWithAppKey:@"YOUR_APP_KEY"];

Ad Unit Set Delegate Methods

  • Rewarded Video
    [IronSource setRewardedVideoDelegate:YOUR_REWARDED_VIDEO_DELEGATE];
  • Interstitial
    [IronSource setInterstitialDelegate:YOUR _INTERSTITIAL_DELEGATE];
  • Offerwall
    [IronSource setOfferwallDelegate:YOUR _OFFERWALL_DELEGATE];

Ad Unit Methods

  • Rewarded Video
    Replace the Supersonic methods:
    //Call this method to show Rewarded Video ad
     [[Supersonic sharedInstance] showRV];
    //Call this method to check ad availability
      [IronSource rewardedVideoHasChangedAvailability:(BOOL)available];
    //Call this method to request ad availability directly
      [[Supersonic sharedInstance]isAdAvailable];
    //Verify if a certain placement has reached its ad limit
      [[Supersonic sharedInstance]isRewardedVideoPlacementCapped:@"Placement"];

    With the ironSource methods:

    //Call this method to show Rewarded Video ad 
      [IronSource showRewardedVideoWithViewController:(UIViewController *)viewController];
    //Call this method to show a Rewarded Video ad in a specific placement
      [IronSourceshowRewardedVideoWithViewController:(UIViewController *)viewController placement:(nullable NSString *)placementName];
    //Call this method to check ad availability
      [IronSource rewardedVideoHasChangedAvailability:(BOOL)available];
    //Call this method to request ad availability directly
      [IronSource hasRewardedVideo];
    //Verify if a certain placement has reached its ad limit
      [IronSource isRewardedVideoCappedForPlacement:@"Placement"];
  • Interstitial
    Replace the Supersonic methods:
    //Call this method to request an Interstitial ad
      [[Supersonic sharedInstance]loadIS];
    //Call this method to request ad availability directly
      [[Supersonic sharedInstance]isInterstitialAvailable];
    //Call this method to show Interstitial 
      [[Supersonic sharedInstance] showISWithViewController:viewcontroller];
    //Call this method to check if a certain placement has reached its ad limit
      [[Supersonic sharedInstance]isInterstitialPlacementCapped:@"Placement"];

    With the ironSource methods:

    //Call this method to request an Interstitial ad
     [IronSource loadInterstitial];
    // Call this method to request ad availability directly
      [IronSource hasInterstitial];
    //Call this method to show Interstitial in a specific placement
      [IronSource showInterstitialWithViewController:YOUR_VIEWCONTROLLER placement:YOUR_PLACEMENT_NAME]
    //Call this method to check if a certain placement has reached its ad limit
     [IronSource isInterstitialCappedForPlacement:(NSString *)placementName];
    
  • Offerwall
    Replace the Supersonic Methods:
    //Call this method to show Offerwall when user clicks the Offerwall button 
     [[Supersonic sharedInstance] showOW];
    //Call this method to show Offerwall when user clicks the Offerwall button //in a specific placement
      [[Supersonic sharedInstance]showOWWithPlacement:placementName];
    //Call this method to receive information on total user credits or new credits //earned
      [[Supersonic sharedInstance] getOWCredits];

    With the ironSource Methods:

    /**Call this method to show Offerwall when user clicks the Offerwall button 
    [IronSource showOfferwallWithViewController:YOUR_VIEWCONTROLLER];
    /**Call this method to show Offerwall when user clicks the Offerwall button *in a specific placement
    /*
    [IronSource showOfferwallWithViewController:YOUR_VIEWCONTROLLER placement:YOUR_PLACEMENT_NAME];
    /**Call this method to receive information on total user credits or new credits *earned
    /*
    [IronSource offerwallCredits];

DynamicUserID (Only for Rewarded Video)
The Dynamic UserID is a parameter that can be changed throughout the session and will be received in the server-to-server ad rewarded callbacks. This parameter helps verify AdRewarded transactions and must be set before calling ShowRewardedVideo.

[IronSource setDynamicUserId:@"DynamicUserId"];

Step 4. Update Delegates

Lastly, you will need to update the Delegate classes for the ad units you’d like to serve on your app.

Rewarded Video

#pragma mark - ISRewardedVideoDelegate
//Called after a rewarded video has changed its availability.
//@param available The new rewarded video availability. YES if available and ready to be shown, NO //otherwise.
- (void)rewardedVideoHasChangedAvailability:(BOOL)available {
}
//Called after a rewarded video has been viewed completely and the user is eligible for reward.
// @param placementInfo An object that contains the placement's reward name and amount.
- (void)didReceiveRewardForPlacement:(ISPlacementInfo *)placementInfo {
}
//Called after a rewarded video has attempted to show but failed.
//@param error The reason for the error
- (void)rewardedVideoDidFailToShowWithError:(NSError *)error {
}
//Called after a rewarded video has been opened.
- (void)rewardedVideoDidOpen {
}
//Called after a rewarded video has been dismissed.
- (void)rewardedVideoDidClose {
}
//Note: the events below are not available for all supported rewarded video ad networks.
//Check which events are available per ad network you choose to include in your build.
//We recommend only using events which register to ALL ad networks you include in your build.
//Called after a rewarded video has started playing.
- (void)rewardedVideoDidStart {
}
//Called after a rewarded video has finished playing.
- (void)rewardedVideoDidEnd {
}

Interstitial

#pragma mark - ISInterstitialDelegate
//This method is invoked when the Interstitial Ad is ready to be shown
- (void)interstitialDidLoad {}
// This method is invoked when there is no Interstitial Ad available after //calling load function.
- (void)interstitialDidFailToLoadWithError:(NSError *)error {}
// Invoked when the Interstitial Ad Unit is opened
- (void)interstitialDidOpen {}
// The method will be called each time the Interstitial windows has opened successfully.
- (void)interstitialDidShow {}
// This method gets invoked after a failed attempt to load Interstitial.
// If it does happen, check out 'error' for more information and consult our
// Knowledge center.
- (void)interstitialDidFailToShowWithError:(NSError *)error {}
// This method will be called each time the user had clicked the Interstitial //ad.
- (void)didClickInterstitial {}
// This method is invoked after the Interstitial window had closed and //control returns to your application.
- (void)interstitialDidClose {}
@end

Offerwall

#pragma mark - ISOfferwallDelegate
// This method gets invoked after the availability of the Offerwall changes.
- (void)offerwallHasChangedAvailability:(BOOL)available {}
// This method gets invoked each time the Offerwall loaded successfully.
- (void)offerwallDidShow {}
// This method gets invoked after a failed attempt to load the Offerwall.
// If it does happen, check out 'error' for more information and consult our
// Knowledge center.
- (void)offerwallDidFailToShowWithError:(NSError *)error {}
// This method gets invoked after the user had clicked the little
// 'x' button at the top-right corner of the screen.
- (void)offerwallDidClose {}
// This method will be called each time the user has completed an offer.
// All relative information is stored in 'creditInfo' and it is
// specified in more detail in 'SupersonicOWDelegate.h'.
// If you return NO the credit for the last offer will be added to
// Everytime you return 'NO' we aggragate the credit and return it all
// at one time when you return 'YES'.
- (BOOL)didReceiveOfferwallCredits:(NSDictionary *)creditInfo {
    return YES;
}
// This method get invoked when the ‘-getOWCredits’ fails to retrieve
// the user's credit balance info.
- (void)didFailToReceiveOfferwallCreditsWithError:(NSError *)error {}
@end

Done! You just updated to the latest ironSource SDK! 
You are now ready to start working with ironSource’s Ad Units and our advanced mediation platform.


What’s Next?

Verify your integration with our Integration Helper and start implementing our ad units:

Interested in Mediation? Integrate our Rewarded Video or Interstitial Ads in your app and follow our Mediation guides.