LevelPlay/IronSource
Initialization
- Integrate the LevelPlay Unity plugin 8.10.2 or 9.x by following the official LevelPlay documentation. Plugin 7.x is not supported since Magify SDK 5.0.4;
- In ProjectSettings, add define
LEVELPLAY_MEDIATORfor your target platforms. If you installed plugin 8.10.2 from a.unitypackage, also add defineLEVELPLAY_8; plugin 9.x and plugin 8.10.2 from the Package Manager need no extra define; - Initialize SDK and configure the LevelPlay app keys and ad unit ids in MagifySettings;
- After calling MagifyService.Initialize() use the MagifyService.UseEmbeddedLevelPlayMediator() and MagifyService.InitializeEmbeddedLevelPlayMediator() methods, which will instruct SDK to use
LevelPlayMediatoras the advertisement source:
MagifyService.Initialize(_magifySettings, _magifyServiceArgs)
.UseEmbeddedLevelPlayMediator()
.InitializeEmbeddedLevelPlayMediator();
OR
MagifyService.Initialize(_magifySettings, _magifyServiceArgs)
.UseEmbeddedLevelPlayMediator();
// wait for other services loading
MagifyService.InitializeEmbeddedLevelPlayMediator(testSuite: true); // pass true if you want to debug LevelPlay with test suite
Usage
You can use the LevelPlayMediator class to load and display the necessary advertisements as you need.
However, you don't have to show all of your ads through it. If you already have ads in your application via the LevelPlay SDK, Magify SDK in conjunction with the LevelPlayMediator class will track their impressions. Clicks and load failures are tracked only for the ads shown through LevelPlayMediator.
With the advanced integration you can pass the clicks and load failures of your own banner to Magify SDK. They are counted for the last banner campaign requested in the session; without such a campaign they are not tracked:
var banner = new LevelPlayBannerAd(adUnitId);
banner.OnAdClicked += _ => MagifyManager.TrackAdsClickFor(CampaignType.Banner);
banner.OnAdLoadFailed += error => MagifyManager.TrackImpressionFailFor(CampaignType.Banner, error.ErrorMessage);
banner.LoadAd();
This class fully implements the IAdsMediator interface and provides basic control over advertising. However, we also provide some handy tools to simplify and improve your ad experience. For this purpose you can check Advertisement and Preloading.