How to update your app code to work on LevelPlay (Unity)

How to update your app code to work on LevelPlay (Unity) 

What do you need to do? 

  1. Download the latest version of the ironSource SDK
  2. Remove the MoPub folder from your project
  3. Change your APIs and callbacks to work with the ironSource SDK 
  4. Make sure your network adapters are updated 
  5. Test your integration and build your app 

Step 1. Download the latest version of the ironSource SDK 

Download Unity Plugin Version 7.1.12.2

Step 2. Remove the MoPub folder from your project

Start by deleting the MoPub manager from the Hierarchy section in your Unity IDE:

MoPubManager

Then, delete the MoPub folder:

Step 3. Change your APIs and callbacks to work with the ironSource SDK 

Init 

When you initialize the ironSource SDK, please note that ironSource only requires your app key. If you are migrating your app using ironSource’s platform migration tool, a new app key will be created for you. You can find your new app key with the migrated app, inside the platform dashboard.

The network configurations are retrieved automatically from the LevelPlay platform. Some information can be shared directly with the networks using ironSource SetMetaData API. For more information please refer to the network’s integration documentation.

If you wish to report GDPR Consent, CCPA or COPPA per user, we advise doing so before your first init. You can learn more about it here.

MoPub IronSource.Agent
MoPub.InitializeSdk(SdkConfiguration); IronSource.Agent.init(YOUR_APP_KEY);

Rewarded Ads 

ironSource Rewarded Video ads are continually loading so that a rewarded video is always available to play.  To display a rewarded video ad, check the ad’s availability and then show the rewarded video. 

Learn more about implementing ironSource Rewarded Video ads here.

API:

MoPub IronSource.Agent
Load Ad RequestRewardedVideo(adUnit, mediationSettings, keywords, latitude, longitude, customerId); ironSource is responsible for loading the rewarded ads for you
Check HasRewardedVideo(adUnit); isRewardedVideoAvailable();
Show Ad ShowRewardedVideo(adUnit); showRewardedVideo();

Callbacks:

MoPubManager IronSourceEvents
OnRewardedVideoLoadedEvent onRewardedVideoAvailabilityChangedEvent(true)
OnRewardedVideoFailedEvent onRewardedVideoAvailabilityChangedEvent(false)
OnRewardedVideoExpiredEvent N/A
OnRewardedVideoShownEvent onRewardedVideoAdOpenedEvent
OnRewardedVideoClickedEvent onRewardedVideoAdClickedEvent
OnRewardedVideoFailedToPlayEvent onRewardedVideoAdShowFailedEvent
OnRewardedVideoReceivedRewardEvent onRewardedVideoAdRewardedEvent
*See Reward Event Map below
OnRewardedVideoClosedEvent onRewardedVideoAdClosedEvent
OnRewardedVideoLeavingApplicationEvent N/A

Reward Event Map:

Event MopubManager.OnRewardedVideoReceivedRewardEvent IronSourceEvents.onRewardedVideoAdRewardedEvent
Returned Object N/A IronSourcePlacement

Reward Data
String adunitId getPlacementName();
String label getRewardName();
Integer amount getRewardAmount();


Interstitials

Use ironSource APIs to Load and Show an interstitial ads. Learn more about interstitial ads here.

API:

MoPub ironSource
Load RequestInterstitialAd(adUnit); loadInterstitial (placementName);
Show ShowInterstitialAd(adUnit); ​​showInterstitial (placementName);

Callbacks:

MoPubManager IronSourceEvents
OnInterstitialLoadedEvent onInterstitialAdReadyEvent
OnInterstitialFailedEvent onInterstitialAdLoadFailedEvent
OnInterstitialDismissedEvent onInterstitialAdClosedEvent
OnInterstitialExpiredEvent N/A
OnInterstitialShownEvent onInterstitialAdOpenedEvent
OnInterstitialClickedEvent onInterstitialAdClickedEvent

Banners

ironSource banners support both predefined sizes and custom sizes. Learn more about ironSource banners implementation and features here.

API

MoPub IronSource.Agent
Load RequestBanner(adUnit, position, size); loadBanner(size, position, placement);
Show ShowBanner(adUnit, true); displayBanner();
Hide ShowBanner(adUnit, false);  hideBanner();
Destroy DestroyBanner(adUnit); destroyBanner();

Callbacks

MoPubManager IronSourceEvents
OnAdLoadedEvent onBannerAdLoadedEvent
OnAdFailedEvent onBannerAdLoadFailedEvent
OnAdClickedEvent onBannerAdClickedEvent
OnAdExpandedEvent Not supported
OnAdCollapsedEvent Not supported

Banner/MREC size mapping

These are the supported banner sizes in ironSource mediation: 

MaxAdSize (MoPub) IronSourceBannerSize
Width300Height250 RECTANGLE

Width320Height50

BANNER
ScreenWidthHeight90 LARGE
Width728Height90 SMART

For other banner sizes, use ironSource custom banner size: 

IronSource.Agent.loadBanner(new IronSourceBannerSize(Width, Height), Position);


Step 4. Make sure your network adapters are updated

To update your network adapters, read the integration documentation.

You can find a list of the most recent supported network SDK adapter versions here.

Step 5. Test your integration and build your app 

The ironSource SDK and Unity Plugin provides an easy way to verify that you’ve successfully integrated the ironSource SDK and any additional adapters. It also makes sure all required dependencies and frameworks were added for the various Mediated Ad Networks.

Documentation is available here.