Guide to migrating to version 6
Warning
Be sure to update to the latest adapter versions (Yandex Mediation and adapters for third-party mediation networks). Otherwise, errors from improper adapter integration might occur, preventing the ad from being served.
For proper operation, enable custom templates for the generated project. To do this, in the build settings (Build Settings → Player Settings → Publishing Settings → Build), select Custom Main Gradle Template.
We recommend that you always enable Custom Main Gradle Template and Custom Gradle Properties Template when building a Unity app to avoid other potential errors.
Banners
Renamed the AdSize class to BannerAdSize. Removed the flexibleSize(int width, int maxHeight) method.
Use methods depending on your ad type:
To create an adaptive sticky banner, use the BannerAdSize.stickySize(int width) method.
An adaptive sticky banner is a small, automatically updated ad placed at the bottom or top of the app screen.
The banner doesn't overlap the main app content and is often used in gaming apps.
The height of the sticky banner is determined automatically, adapting to the device screen size and not exceeding 15% of the screen height.
Warning
Starting with version 6.0.0, adaptive sticky banners can refresh automatically.
If you previously implemented auto-refresh for a sticky-banner, you should now disable it.
To create an adaptive inline banner, use the BannerAdSize.inlineSize(int width, int maxHeight) method.
An adaptive inline banner is a flexible banner ad format that ensures maximum efficiency by optimizing ad size for each device.
The banner height is selected automatically and can reach the height of the device screen.
Typically, this format is used in feed-based apps or contexts where it's acceptable to primarily focus user attention on ads.
The fixedSize(int width, int height) method has been retained for backward compatibility, but we don't recommend using it. Use inlineSize(int width, int maxHeight) or stickySize(int width) instead. In SDK 6.1.0, banner height is calculated automatically and known before sending the ad request. This height can be used for screen layout design.
Rewarded ads
The approach to creating and loading advertisements has been revised. Now there's a RewardedAdLoader object responsible for loading ads and a RewardedAd object derived from the OnAdLoaded ad loading event.
To learn more about the new API, see the SDK reference.
|
Loading ads |
SDK 5 One object is now used both for loading and serving ads:
SDK 6
|
|
Ad serving |
SDK 5 Check if the ad is loaded before displaying it.
SDK 6 You don't need to check whether the ad has been loaded.
|
|
Subscribing to ad lifecycle events |
SDK 5 All events come in a single
SDK 6 Ad loading events are received in the
|
Interstitial ads
The approach to creating and loading advertisements has been revised. There's now an InterstitialAdLoader loader object that handles ad loading and an Interstitial ad object derived from the ad loading OnAdLoaded event .
To learn more about the new API, see the SDK reference.
|
Loading ads |
SDK 5 One object is now used both for loading and serving ads:
SDK 6
|
|
Ad serving |
SDK 5 Check if the ad is loaded before displaying it.
SDK 6 You don't need to check whether the ad has been loaded.
|
|
Subscribing to ad lifecycle events |
SDK 5 All events come in a single
SDK 6 Ad loading events are received in the
|
App open ads
Added a new ad format: app open ads. To learn more, see App open ads.
Yandex Mediation
Warning
Be sure to update to the latest adapter versions (Yandex Mediation and adapters for third-party mediation networks). Otherwise, errors from improper adapter integration might occur, preventing the ad from being served.
Renamed the package mobileads-admob-mediation-2.9.0.unitypackage to mobileads-google-mediation-6.0.0.unitypackage.
If you use a unified mediation build, you do not need to do anything. If you're connecting adapters manually, first manually remove the old package and then add the new one.
You can view complete integration examples here:
- Link to GitHub.