Ironsource Unity



  1. The Unity Ads addon extends the IronSource SDK to implement Unity Ads ad-network mediation for both Android and iOS. It supports banner, interstitial and rewarded video advertisements. It also has complete advertisement management features with both GDPR and CCPA compliance.
  2. Add the ironSource Unity package to your project. Follow these steps to add the IronSource Unity Package to your project: Download Unity Plugin Version 7.1.5.1; Make sure your Unity project is opened and import the Unity package. Double-click on the extracted file; the different files will be populated automatically as shown below.

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. IronSource mediation demo app. The ironSource Unity Plugin fires several events to inform you of ad availability and activity. Under IronSource/Assets/Prefabs, you’ll find the IronSourceEventsPrefab. Add it to your project to receive these events. With ironSource’s Ad Placements, you can customize and optimize the Interstitial experience. This tool enables you to present Interstitial ads to your users in different places, i.e. App launch, between levels, etc. You can use the below function to define the exact placement to show an ad from.

Before You Start

Ironsource Unity

We support Unity version 5 and up.

Step 1. Add the IronSource Unity Package to Your Project

Disclaimer: Updating theironSource SDK
When upgrading from older SDK versions to theironSource SDK 6.7.0 and above, you must update all mediation adapters.

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

Interstitial Integration For Unity Plugin - IronSource ...

  1. Download the IronSource Unity Plugin here.
  2. Make sure your Unity project is opened and import the Unity package.
  3. Double-click on the extracted file; the different files will be populated automatically as shown below:

Important! Using the Unity Editor with theironSource SDK
TheironSource 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 AssetsPluginsAndroidIronSourceAndroidManifest.xml checked and skip to Google Play Services integration.
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 AndroidManifest.xml file outside the <application> tag:
    • Manifest Activities
      Add the following activities inside the <application> tag on your manifestAdditions:
  2. Google Play Services
    1. Download the support-v4-[version].jar. Add the jarto your project under App/Libs.
    2. We recommend using Google Play Services as theironSource 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 yourinfo.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.
      Note: Note: Make sure that your info.plist does not contain any other exceptions besides ‘NSAllowsArbitraryLoads‘, as this might create a conflict.

Step 4. Initialize the Ad Units

Integration ironSource supports optional SDK settings such as UserID and Segments that must be configured before you initialize the SDK. See our guide on Additional SDK Settings for setup instructions.
Note: Note: If you’re serving the Offerwall ad unit or using server-to-server callbacks to reward your users with our rewarded ad units, you must set the UserID.

Application State

Ironsource Unity

Ironsource Unity

First, you’ll need to pass the state of the application by executing the following event function during the Application Lifecycle.

Call onApplicationPause in each of the Unity Scenes:

Init the Plugin & Ad Units

You can initialize the plugin in two ways. We recommend the first method as it will fetch the specific ad units you define.

  1. This method will init the specific ad units mentioned in the adUnits parameter:

    New!When using this init approach, you can now initialize each ad unit separately at different touchpoints in your app flow in one session.

  2. Alternatively, you can init the SDK as detailed below and the SDK will init the ad units you’ve configured on the ironSource platform:

Ironsource Unity

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 have implemented, simply add this method to your project:

For more details on the ironSource Integration Verification tool navigate to this article.

For Proguard Users Only

Ironsource Unity

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):

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

Ironsource Unity Tutorial

What’s Next?

6. AdKit Demo Tutorials - IronSource

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.

SDK Change Log - IronSource Knowledge Center

You can read this article in: