Get Started with the ironSource Xamarin Plugin for iOS

iOS 14 Support To be compatible with iOS 14, ironSource released SDK 7+ with support for SKAdNetwork attribution. You can learn more about updating to SDK 7 here.
You can learn about mediated networks readiness here

Step 1. Add the ironSource Plugin to Your Project

ironSource Xamarin plugin requires adding two files and incorporate additional arguments.

  1. Download the ironSource Xamarin dll for iOS and add it to your app as follows:
    Download Xamarin dll for iOS
    1. In the Solution Explorer, under your project, right click on References > Edit References…
    2. Navigate to the .Net Assembly tab and click on Browse
    3. Select the dll that you just downloaded
  2. Download ironSource framework and add it to your app as follows:
    Download Xamarin Framework for iOS
    1. In the Solution Explorer, right-click on the project name and select Add > Add Native Reference
    2. Select the framework that you just downloaded
  3. Add the additional arguments as follows:
    1. Right click the project in the solution manager
    2. Click on properties
    3. Select Build under the iOS section 
    4. Choose the relevant configuration and platform, and add the following:
      -gcc_flags "-ObjC"

ironSource Mediation Demo App

The Integration Demo application demonstrate how to integrate the Unity LevelPlay Mediation in your app.
Download Xamarin Demo Application for iOS

Step 2. Import the ironSource Files

Import the references to your ViewController:

using IronSourceiOS;

Then, set the following plugin data parameters:

ISConfigurations.Configurations.Plugin = “Xamarin”;
ISConfigurations.Configurations.PluginVersion = IronSource.SdkVersion;
//Insert your Visual Studio version 
ISConfigurations.Configurations.PluginFrameworkVersion = YOUR_XAMARIN_FRAMEWORK_VERSION;

Step 3. Initialize the Plugin

Init the Plugin and Rewarded Video:

IronSource.InitWithAppKey(txtAppKey.Text, new string[]{“rewardedvideo”});

Note: ironSource supports Network Change Status, which enables the Plugin to change its availability according to network modifications, i.e. in the case of no network connection, the availability will turn to FALSE.
The default of this function is False; in case you’d like to utilize it, you can activate it in the Init with the following string:
IronSource.ShouldTrackReachability(true);

Init Complete Callback

The ironSource SDK fires callback to inform you that the ironSource SDK was initialized successfully, for ironSource SDK 7.2.1+ . This listener will provide you an indication that the initialization process was completed, and you can start loading ads. The callback will be sent once per session, and will indicate the first initialization of the SDK.  To receive this callback, we suggest the following:

  1. Create a class that inherits from ISInitializationDelegate
    public class InitializationDelegate : ISInitializationDelegate
        {
            readonly ViewController view;
            public InitializationDelegate(ViewController view)
            {
                this.view = view;
            }
            public override void initializationDidComplete()
            {
            }
        }

  2. Create and instantiate an InitializationDelegate object, and use it to init ironSource SDK
InitializationDelegate mInitializationDelegate;
mInitializationDelegate = new InitializationDelegate(this);
IronSource.InitWithAppKey(string appKey, mInitializationDelegate);

Step 4. Verify Your Integration

The ironSource SDK provides an easy way to verify that your SDK and ad unit integration was completed successfully. Call this method to verify your integration:

ISIntegrationHelper.ValidateIntegration();

Done! You just integrated the ironSource Plugin in your app.
You are now ready to start working with Unity LevelPlay’s Ad Units.


What's next?

For additional mediation networks, follow Xamarin iOS adapters guide.

For additional settings available to you through the SDK, follow Additional SDK Settings.

Once you’ve verified your integration with the Integration Helper, follow our Rewarded Video integration guide to implement the ad unit.

To view Xamarin change Log and additional Settings return to Xamarin Dev Integration