Getting Started with ironSource Unity Plugin

To begin monetizing your application with the ironSource SDK, follow these 4 easy steps:

  1. Add the Supersonic Unity Package to your Project
  2. Additional Settings for Android
  3. Additional Settings for iOS
  4. Start The Supersonic Agent
  5. Verify Your Integration

Before You Start

We support Unity version 5 and up.

Step 1. Add the Supersonic Unity Package to Your Project

Note:  Note: If you are upgrading from a previous version of the ironSource SDK, you must completely remove it from your project, otherwise it will cause issues with the update. We also recommend erasing older builds from test devices and making a new build.
Disclaimer: Updating the ironSource SDK
When upgrading from older SDK versions to the ironSource SDK 6.4.17+, you must update all mediation adapters. 

Follow these steps to add the Supersonic Unity Package to your project:

  1. Download the Supersonic Unity Plugin.
  2. Make sure your Unity project is opened and unzip the Unity Package.
  3. Double-click on the extracted file; the different files will be populated automatically as shown below:
    Import Unity Package in Getting Started

Important! Using the Unity Editor with the ironSource SDK
The ironSource SDK is designed to work with the Android & iOS platform. The Unity Editor contains a Simulator to work with Unity code. In order to work with our plugin, you must target either an Android or iOS build to test the integration.

Step 2. Additional Settings for Android

In the case your application doesn’t have an AndroidManifest, leave the checkbox under SupersonicPluginsAndroidSupersonic ➣ AndroidManifest.xml checked and skip to step 2.
If you do have an AndroidManifest, please uncheck the box and follow the steps below.
  1. Update AndroidManifest.xml
    Add the following to your AndroidManifest.xml:
    • Manifest Permissions
      Add the following permissions to your Application Descriptor.xml file inside the manifestAdditions tag but outside the <application> tag:
      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    • Manifest Activities
      Add the following activities inside the <application> tag on your manifestAdditions:
      <activity
      android:name="com.supersonicads.sdk.controller.ControllerActivity"
      android:configChanges="orientation|screenSize"
      android:hardwareAccelerated="true" />
      <activity
      android:name="com.supersonicads.sdk.controller.InterstitialActivity"
      android:configChanges="orientation|screenSize"
      android:hardwareAccelerated="true"
      android:theme="@android:style/Theme.Translucent" />
      <activity
      android:name="com.supersonicads.sdk.controller.OpenUrlActivity"
      android:configChanges="orientation|screenSize"
      android:hardwareAccelerated="true"
      android:theme="@android:style/Theme.Translucent" />
  2. Google Play Services
    We recommend using Google Play Services as the ironSource Plugin requires the Android Advertising ID to ensure ad inventory at scale. Follow this guide on how to integrate the Google Play Services AAR.

Step 3. Additional Settings for iOS

  1. Add Ad-Support.framework to Your Xcode Project
    Our Unity Plugin usually adds all the required frameworks automatically. In some cases, the AdSupport.framework can’t be added automatically using Unity 5. Verify if the framework has been added and in the case it has not been added automatically, make sure to add it manually.
  2. iOS9 App Transport Security Settings
    Important!
     In iOS9, Apple has added in controls around ‘ATS’. In order to ensure uninterrupted support for ironSource Ad delivery across all Mediation Networks, it’s important to make the following changes in your info.plist:
    • Add in a dictionary called ‘NSAppTransportSecurity‘. Make sure you add this dictionary on the ‘Top Level Key‘.
    • Inside this dictionary, add a Boolean called ‘NSAllowsArbitraryLoads‘ and set it to YES.
      Supersonic iOS9 App Transport Security Settings
      Note: Note: Make sure that your info.plist does not contain any other exceptions besides ‘NSAllowsArbitraryLoads‘, as this might create a conflict.

Step 4. Start the Supersonic Agent

To start a Supersonic Instance you must implement the relevant code on application launch as well as during the application lifecycle.

  1. On Application Launch:
    public class YourApp : MonoBehaviour {
    //For example, add the following inside “start()” method:
    void start() {
         Supersonic.Agent.start();
         }
    }
  2. During the Application Lifecycle:
    Call onResume and onPause in each of the Unity Scenes:
    void OnApplicationPause(bool isPaused) { 
    if (isPaused) {
      Supersonic.Agent.onPause ();
      }else{                   
      Supersonic.Agent.onResume ();
      }
    }

Step 5. Verify Your Integration

The ironSource SDK provides an easy way to verify that your Rewarded Video Mediation integration was completed successfully. To verify your ironSource SDK integration as well as any additional Ad Networks you may have implemented, navigate to this article.

For Proguard Users Only

If you are using ProGuard with the ironSource SDK, you must add the following code to your ProGuard file (Android Studio: proguard-rules.pro or Eclipse: proguard-project.txt):

-keepclassmembers class com.supersonicads.sdk.controller.SupersonicWebView$JSInterface {
    public *;
}
-keepclassmembers class * implements android.os.Parcelable {
    public static final android.os.Parcelable$Creator *;
}
-keep public class com.google.android.gms.ads.** {
   public *;
}
-keep class com.supersonic.adapters.** { *; 
}

Done!
You are now ready to start working with ironSource’s Ad Units and Mediation Tools.


What’s Next?

Once you’ve verified your integration with the Integration Helper, follow our integration guides and implement our Ad Units:

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