ironSource Init 7.9.0

Step 5. Initialize the SDK

Important! ironSource  SDK supports optional SDK settings such as UserID and Segments that must be configured before you initialize the SDK. See our guide on Advanced SDK Settings for setup instructions.
If you’re using server-to-server callbacks to reward your users with our rewarded ad units, or using ad Quality user journey, you must set the UserID.

Init the SDK

The SDK can be initialized in two ways:

  1. We recommend this approach as it will fetch the specific ad units you define in the adUnits parameter. Ad unit is a string array.
    /**
    *Ad Units should be in the type of IronSource.Ad_Unit.AdUnitName, example 
    */
    IronSource.init(this, appKey, IronSource.AD_UNIT.INTERSTITIAL, IronSource.AD_UNIT.REWARDED_VIDEO, IronSource.AD_UNIT.BANNER);

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

    //Rewarded Video
    IronSource.init(this, appKey, IronSource.AD_UNIT.REWARDED_VIDEO);
    //Init Interstitial 
    IronSource.init(this, appKey, IronSource.AD_UNIT.INTERSTITIAL); 
    //Init Banner
    IronSource.init(this, appKey, IronSource.AD_UNIT.BANNER);
  2. Alternatively, you can init the SDK as detailed below and the SDK will init the ad units you’ve configured on the LevelPlay platform:
    IronSource.init(this, appKey);

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. 

IronSource.init(this, APP_KEY, new InitializationListener() {
   @Override
   public void onInitializationComplete() {
     // ironSource SDK is initialized  
   }
});
IronSource.init(this, APP_KEY) {
   // ironSource SDK is initialized 
}