Skip to content

SDK Migration

d.eshenko edited this page Dec 28, 2022 · 1 revision

This page covers migrations for current and previous versions.

Migrate from 2.x to 3.0

The table below lists the removed/replaced methods in version 3.0.

MobileAds

Outdated initialization methods have been removed from the MobileAds class.

Removed New
IMediationManager Initialize() BuildManager().Initialize()
IMediationManager InitializeFromResources() BuildManager().Initialize()
string GetActiveMediationPattern() GetActiveNetworks()

IMediationManager

The general ad loading events have been completely replaced with new separate events for each ad format.

Removed New
event OnLoadedAd OnInterstitialAdLoaded, OnRewardedAdLoaded
event OnFailedToLoadAd OnInterstitialAdFailedToLoad, OnRewardedAdFailedToLoad
string GetLastActiveMediation() No longer supported

Banner migration to multi-size implementation

Use IAdView for each banner ad size instead of IMediationManager methods. Call manager.GetAdView(AdSize) to get IAdView instance for specific ad size.

Removed from IMediationManager New in IAdView
event OnBannerAdOpening OnImpression
event OnBannerAdFailedToShow OnFailed
event OnBannerAdClicked OnClicked
event OnBannerAdHidden No longer supported
event OnBannerAdShown No longer supported
AdSize bannerSize size
AdPosition bannerPosition position
void Show(AdType.Banner) SetActive(true)
void HideBanner() SetActive(false)
float GetBannerHeightInPixels() rectInPixels.height
float GetBannerWidthInPixels() rectInPixels.width

IAdView

Banner visibility change events are no longer supported because they are invoked at the same time that SetActive() is changed.

Removed New
event OnPresented No longer supported
event OnHidden No longer supported

BannerAdObject

Removed New
float GetHeightInPixels() rectInPixels.height
float GetWidthInPixels() rectInPixels.width
Clone this wiki locally