Get Started with the ironSource Xamarin Plugin for Android

Step 1. Add the ironSource Plugin to Your Project

Download the Xamarin plugin, and add it to your app as follows:
Download Xamarin Plugin for Android

  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

ironSource Mediation Demo App

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

Step 2. Update AndroidManifest.xml

Add the following to your AndroidManifest.xml:

Manifest Permissions

<uses-permission android:name=“android.permission.ACCESS_NETWORK_STATE” />
<uses-permission android:name=“android.permission.INTERNET” />

Manifest Activities

<activity android:name=“com.ironsource.sdk.controller.ControllerActivity” android:configChanges=“orientation|screenSize” android:hardwareAccelerated=“true” />
<activity android:name=“com.ironsource.sdk.controller.InterstitialActivity” android:configChanges=“orientation|screenSize” android:hardwareAccelerated=“true” android:theme=“@android:style/Theme.Translucent” />
<activity android:name=“com.ironsource.sdk.controller.OpenUrlActivity” android:configChanges=“orientation|screenSize” android:hardwareAccelerated=“true” android:theme=“@android:style/Theme.Translucent” />

Step 3. Import the ironSource Files

Import the references to your activity:

using Com.Ironsource.Mediationsdk;
using Com.Ironsource.Mediationsdk.Sdk;
using Com.Ironsource.Mediationsdk.Model;
using Com.Ironsource.Mediationsdk.Logger;
using Com.Ironsource.Mediationsdk.Config;
using Com.Ironsource.Mediationsdk.Utils;

Then, call the following method to set the plugin data:

ConfigFile.GetConfigFile().SetPluginData(“Xamarin”, IronSourceUtils.SDKVersion, YOUR_XAMARIN_FRAMEWORK_VERSION);

Step 4. Override Your Activity Lifecycle Methods

Application Lifecycle
Override the onPause(), onResume() methods in each of your activities to call the corresponding ironSource methods as follows:

protected override void OnPause()
protected override void OnResume()

Step 5. Initialize the Plugin

Init the Plugin and Rewarded Video:

IronSource.Init(this, YOUR_APP_KEY, IronSource.AD_UNIT.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.ShouldTrackNetworkState(this, true);

Step 6. Verify Your Integration

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

  • Import this reference to be able to call the integration helper method
    using Com.Ironsource.Mediationsdk.Integration;
  • Then call this method to verify your integration:

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

What's next?

For additional mediation networks, follow Xamarin Android 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