ironSource Init 7.9.0
Step 5. Initialize the SDK
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:
- 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);
- 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.