- Key changes
- 1. Changes to AdRequest
- 2. Changes to Targeting
- 3. Changes to ad loaders
- 3.1 Support for structured concurrency
- 4. Changes to the Banner API
- 5. Changes to AdInfo
- 6. Changes to the main SDK class
- 7. Changes to ad object delegates
- 8. Changes to Native Ads: Warning
- 9. Changes to Native Ads: Media
- $10. Changes to NativeAd and SliderAd: loadImages
- 11. Removing VideoController
- 12. Removing native templates
- 13. Removed constants and error types
- 14. Swift 6, MainActor, and Sendable
- 15. Other changes
- Changes to the mediation networks API
- SwiftUI integration
- AI-assisted migration
- SKAdNetwork
- Requirements
Guide for migrating to version 8
Yandex Mobile Ads SDK 8.0.0 introduces multiple API changes aimed at improving the developer experience.
For Objective-C projects, see Section 14 (MainActor) to ensure proper handling of MainActor-isolated classes. Perform operations with these classes on the main thread.
AI-assisted migration
To speed up the migration from SDK 7.x to 8.x, use the ready-made migration skill for AI assistants — see the AI-assisted migration section for details.
Key changes
1. Changes to AdRequest
- Use
AdRequestfor all ad formats. - The
AdRequestConfigurationandNativeAdRequestConfigurationclasses and all mutable request classes have been removed. - The
adUnitIDproperty is now passed as a required parameter duringAdRequestinitialization.
|
Class |
Status |
|
|
Removed. Use |
|
|
Removed. Use |
|
|
Removed |
|
|
Removed |
|
|
Removed |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
2. Changes to Targeting
- The fields
age,gender,location,contextQuery, andcontextTagshave been removed fromAdRequest. - To manage the targeting parameters, use the new
AdTargetingclass.
The AdTargetInfo class has been renamed to AdTargeting, and the targetInfo field within AdRequestTokenConfiguration and BidderTokenRequestConfiguration has been renamed to targeting.
|
Class |
Status |
|
|
Renamed to |
|
Class |
Property |
Status |
|
|
|
Removed. Use |
|
|
Removed. Use |
|
|
|
Removed. Use |
|
|
|
Removed. Use |
|
|
|
Removed. Use |
|
|
|
Added |
|
|
|
|
Renamed to |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
3. Changes to ad loaders
- Load delegates have been removed. The load result is now delivered via a
completionhandler. - Pass the
adUnitIDparameter viaAdRequest.
|
Class |
Loader |
Status |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
Class |
Status |
|
|
Removed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
3.1 Support for structured concurrency
All ad loaders now support Swift structured concurrency (async/await).
|
Loader |
Method |
Status |
|
|
|
Added |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Examples
let request = AdRequest(adUnitID: "R-M-XXXXX-YY")
// Interstitial Ads
let interstitialAd = try await interstitialAdLoader.loadAd(with: request)
// Rewarded Ads
let rewardedAd = try await rewardedAdLoader.loadAd(with: request)
// AppOpen Ads
let appOpenAd = try await appOpenAdLoader.loadAd(with: request)
// Native Ads
let options = NativeAdOptions()
let nativeAd = try await nativeAdLoader.loadAd(with: request, options: options)
// Slider Ads
let sliderAd = try await sliderAdLoader.loadAd(with: request, options: options)
// Native Bulk Ads
let nativeAds = try await nativeBulkAdLoader.loadAds(with: request, adsCount: 3, options: options)
Structured concurrency is supported only for Swift.
4. Changes to the Banner API
- The
AdViewclass has been renamed toBannerAdViewand theAdViewDelegateprotocol has been renamed toBannerAdViewDelegate. BannerAdViewno longer includes theadUnitIDproperty, PassadUnitIDto theAdRequestbuilder before each ad load.BannerAdSizefactory methods have been renamed.
|
Class |
Status |
|
|
Renamed to |
|
|
Renamed to |
|
Class |
Property |
Status |
|
|
|
Renamed to |
|
|
Renamed to |
|
|
|
Renamed to |
|
|
|
Renamed to |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Removed |
|
|
|
Replaced with |
|
|
|
|
Renamed to |
|
|
Renamed to |
|
|
|
Renamed to |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
5. Changes to AdInfo
- Some ad object properties have been removed:
info,adAttributes,creativeID, andcampaignID. - Use
adInfo. SomeadInfoproperties have been renamed.
|
Class |
Property |
Status |
|
|
|
Renamed to |
|
|
Renamed to |
|
|
|
Removed |
|
|
|
Added |
|
|
|
|
Replaced with |
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
|
Added |
|
|
Added |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
6. Changes to the main SDK class
- The
MobileAdsclass has been renamed toYandexAds. - Privacy methods and properties have been renamed and moved to a new class.
|
Class |
Status |
|
|
Renamed to |
|
|
Replaced with |
|
|
Renamed to |
|
|
Renamed to |
|
|
Moved to |
|
|
Renamed to |
|
|
Renamed to |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
7. Changes to ad object delegates
The delegate methods AppOpenAdDelegate, InterstitialAdDelegate, RewardedAdDelegate, NativeAdDelegate, and SliderAdDelegate are no longer optional, and all of them must be implemented.
Show methods
|
Class |
Method |
Status |
|
|
|
Renamed to
|
|
|
|
Renamed to
|
|
|
|
Renamed to
|
Impression tracking methods
|
Class |
Method |
Status |
|
|
|
Renamed to
|
|
|
|
Renamed to
|
|
|
|
Renamed to
|
|
|
|
Renamed to
|
|
|
|
Renamed to
|
Removed delegate methods
|
Delegate |
Method |
Status |
|
|
|
Removed |
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|
|
|
||
|
|
||
|
|
8. Changes to Native Ads: Warning
- The
warningfield type withinNativeAdAssetshas been changed fromString?toNativeAdWarning?. NativeAdWarningnow features a new field:minimumRequiredArea. This field specifies the minimum area of the ad that must be allocated to thewarningasset.
|
Class |
Field |
Status |
|
|
|
Field type was changed to |
|
|
|
Added |
|
|
Added |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
9. Changes to Native Ads: Media
NativeAdMedia now includes a new property: hasVideo.
|
Class |
Property |
Status |
|
|
|
Added |
Examples
// SDK 8
if let media = nativeAd.adAssets.media, media.hasVideo {
// Consider video content in ads
}
// SDK 8
if (nativeAd.adAssets.media != nil && nativeAd.adAssets.media.hasVideo) {
// Consider video content in ads
}
$10. Changes to NativeAd and SliderAd: loadImages
- The
loadImages()method has been renamed toloadImages(completionHandler:). - The
NativeAdImageLoadingObserverprotocol has been replaced with thecompletionHandlerparameter. - We've added an asynchronous version of
loadImages().
|
Class |
Status |
|
|
Removed |
|
Class |
Method |
Status |
|
|
|
Replaced with |
|
|
|
Replaced with |
Applicable to NativeAd and SliderAd.
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
11. Removing VideoController
The videoController property and associated classes (VideoController and VideoDelegate) have been removed.
|
Property |
Status |
|
|
Removed |
|
|
|
|
|
|
|
|
12. Removing native templates
Native templates have been completely removed. All associated classes are no longer available.
|
Template |
Status |
|
|
Removed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13. Removed constants and error types
|
Constants and error types |
Status |
|
|
Removed |
|
|
Removed |
|
|
Replaced with the |
|
Constants from |
Replaced with |
|
|
Replaced with |
|
|
Removed |
|
|
Removed |
|
|
Removed |
|
|
Removed |
|
|
Removed |
|
|
Removed |
14. Swift 6, MainActor, and Sendable
- The SDK is built using Swift 6.
- Some classes and protocols are now
MainActor-isolated, and one protocol requiresSendable.
MainActor-isolated classes
|
Class |
|
|
|
|
|
|
|
|
|
|
MainActor-isolated protocols
|
Protocol |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The NativeAdImageLoadingObserver protocol has been removed. Image loading is now handled via a completion handler or async/await.
15. Other changes
|
Class |
Object |
Status |
|
|
|
Replaced with the |
|
|
|
Moved to |
|
|
|
Removed |
|
|
|
Replaced with the |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
Changes to the mediation networks API
1. Changes to AdapterIdentity for mediation adapters
- You can now set the identity of mediation adapters via
AdapterIdentity. - The
mediationNetworkNameparameter is no longer used. - Set the adapter identity globally via
YandexAds.setAdapterIdentity(_:)before SDK initialization.
|
Class |
Parameter |
Status |
|
|
|
Replaced with |
|
|
|
Replaced with |
|
|
|
Added |
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
2. Changes to BidderTokenRequest
- The
BidderTokenRequestConfigurationclass has been renamed toBidderTokenRequest. - The initializer and public properties (
targetInfo,bannerAdSize, andparameters) have been moved to factory method parameters.
|
Class |
Status |
|
|
Renamed to |
|
Class |
Property |
Status |
|
|
|
Replaced with
|
|
|
|
Replaced with
|
|
|
|
Replaced with
|
|
|
|
Replaced with
|
|
|
|
Replaced with
|
|
|
|
Renamed to
|
Applicable to mediation adapters that use BidderTokenLoader.
Examples
|
SDK 7 |
|
|
SDK 8 |
|
|
SDK 7 |
|
|
SDK 8 |
|
SwiftUI integration
The API now supports SwiftUI integration. See the SwiftUI section at the end of the iOS documentation menu:
AI-assisted migration
To simplify the migration from SDK 7.x to 8.x, you can use AI assistants with a pre-configured migration skill.
How it works
- Download the skill
The migration skill is available at GitHub Yandex Ads SDK iOS.
- For Claude Desktop
Copy the skill folder to your agent's skills directory, for example:
cp -r Skills/migrate-yandex-ads-sdk-from-7-to-8 .claude/skills/
- For Cursor IDE
Copy the skill folder to your project and reference the SKILL.md file using @, for example:
@migrate-yandex-ads-sdk-from-7-to-8/SKILL.md
- Another method: Copy the contents of
SKILL.mdand all related files into the chat with the AI assistant. Note that this may exceed message limits.
- Use a prompt
Once the skill is loaded, use the following prompt in your chat with the AI assistant:
Migrate my project from Yandex Mobile Ads SDK 7.x to 8.x
Warning
Always carefully review the AI-generated changes.
Skills help AI assistants handle tasks more effectively, but you must still review all changes made by the agent. AI assistants can make mistakes, so you need to manually review the code.
SKAdNetwork
The SKAdNetwork ID list has been updated, and new tools for automatic updates have been added. For more information on implementation methods and use scenarios, see SKAdNetwork.
Requirements
- Xcode: 16.4 or later
- AppMetricaCore: 6.0.0 or later
- AppMetricaLibraryAdapter: 6.0.0 or later
- AppMetricaAdSupport: 6.0.0 or later
- AppMetricaIDSync: 6.0.0 or later