---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/ios7/release/6-0-0-migration.md
  - https://ads.yandex.com/helpcenter/ru/dev/ios7/release/6-0-0-migration.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/en/llms.txt

# Guide for migrating to version 6

<a href="dev/platforms"> <!--ссылка, куда ведет кнопка. Если внутренняя ссылка, пишем без .md и .html -->
<span class="button">Other platforms</span> <!--текст на кнопке-->
</a>



{% note warning %}

Make sure to update your used [Yandex Mediation](https://ads.yandex.com/helpcenter/en/dev/ios7/list-network.md) adapters and [adapters for third-party mediation networks](https://ads.yandex.com/helpcenter/en/dev/ios7/third-party-mediation.md) to the latest version. Older versions may cause adapter integration errors that can prevent your ads from being served.

{% endnote %}

## Banners

Renamed the `YMAAdSize` class to `YMABannerAdSize`. Removed the `flexibleSizeWithCGSize:(CGSize)size` and `fixedSizeWithCGSize:(CGSize)size` methods previously marked as **deprecated**.

Use methods depending on the ad type:

Use the `stickySizeWithContainerWidth:(CGFloat)width` method to create an adaptive sticky banner.

> That is a small, automatically updated ad placed at the top or bottom of the app screen.
>
> It does not overlap the main app content and is often used in game apps.
>
> The height of a sticky banner is determined automatically, adapting to the screen size of the device and not taking up more than 15% of the screen height.

{% note warning %}

Version 6.0.0 added autorefresh support for adaptive sticky banners.

If you have previously implemented autorefresh for sticky banners, disable it.

{% endnote %}

Use the `inlineSizeWithWidth:(CGFloat)width maxHeight:(CGFloat)height` method to create an adaptive inline banner.

> Adaptive inline banners are a flexible format of banner advertising, providing maximum efficiency by optimizing the ad size on each device.
>
> The height of the banner is adjusted automatically and might reach the device screen height.
>
> Typically, that format is used in feed-based apps or contexts where it's okay to focus primarily on the ad.

For backward compatibility, we added the `fixedSizeWithWidth:(CGFloat)width height:(CGFloat)height` method instead of `fixedSizeWithCGSize:(CGSize)size`. We don't recommend using it, however. Use `stickySizeWithContainerWidth:(CGFloat)width` instead. In SDK 6.0.0, the height of the banner is calculated automatically and known before the ad request is sent. You can use this height in your screen layout.

#|
||
Removed the deprecated method `flexibleSizeWithCGSize:(CGSize)size`
| **SDK 5**
```swift
let adSize = YMAAdSize.flexibleSize(withCGSize: CGSize(width: screenWidth, height: bannerHeight))
```
**SDK 6**
```swift
let adSize = YMABannerAdSize.inlineSize(withWidth: screenWidth, maxHeight: bannerHeight)
```
||
||
Removed the deprecated method `fixedSizeWithCGSize:(CGSize)size`
| **SDK 5**
```swift
let adSize = YMAAdSize.fixedSize(with: CGSize(width: screenWidth, height: bannerHeight))
```
**SDK 6**

Use the `inlineSizeWithWidth:(CGFloat)width maxHeight:(CGFloat)height` method if you need to embed your banner in the content.
```swift
let adSize = YMABannerAdSize.inlineSize(withWidth: screenWidth, maxHeight: bannerHeight)
```

Alternatively, you can use the `stickySizeWithContainerWidth:(CGFloat)width` method if you need to place a banner at the top or bottom of your app screen.
```swift
let adSize = YMABannerAdSize.stickySize(withContainerWidth: screenWidth)
```
||
||
Renamed the `YMAAdSize` class as `YMABannerAdSize`
| **SDK 5**
```swift
let adSize = YMAAdSize.fixedSizeWithWidth(width: screenWidth, height: bannerHeight)
```
**SDK 6**
```swift
let adSize = YMABannerAdSize.stickySize(withContainerWidth: screenWidth)
```
||
||
Renamed the `YMAAdSize` class as `YMABannerAdSize`
| **SDK 5**
```swift
let adSize = YMAAdSize.fixedSizeWithWidth(width: screenWidth, height: bannerHeight)
```
**SDK 6**
```swift
let adSize = YMABannerAdSize.stickySize(withContainerWidth: screenWidth)
```
||
|#

## Rewarded ads

 We changed the approach to creating and loading ads. We now provide the `YMARewardedAdLoader` loader object, which loads ads, with the `YMARewardedAd` ad object retrieved by the loader's delegate methods. The internal logic for loading and rendering ads remains the same. To learn more about the new API, see the [SDK reference](https://doc-static.yandex.net/src/support/RSYA-RMP/mobile-ads/ru/jazzy/Classes/RewardedAd.html).

**SDK 5**

```swift
final class RewardedAdViewController: UIViewController {
   private lazy var rewardedAd: YMARewardedAd = {
        let rewardedAd = YMARewardedAd(adUnitID: "R-M-XXXXX-YY")
        rewardedAd.delegate = self
        return rewardedAd
    }()

    func loadAd() {
      rewardedAd.load()
    }

    func showAd() {
      rewardedAd.present(from: self)
    }

}

```

**SDK 6**

```swift
final class RewardedAdViewController: UIViewController {
   private var rewardedAd: YMARewardedAd?
   private lazy var rewardedAdLoader: YMARewardedAdLoader = {
        let loader = YMARewardedAdLoader()
        loader.delegate = self
        return loader
    }()

    func loadAd() {
      let configuration = YMAAdRequestConfiguration(adUnitID: "R-M-XXXXX-YY")
      rewardedAdLoader.loadAd(with: configuration)
    }

    func showAd() {
      rewardedAd?.show(from: self)
    }

}

extension RewardedAdViewController: YMARewardedAdLoaderDelegate {
   func rewardedAdLoader(_ adLoader: YMARewardedAdLoader, didLoad rewardedAd: YMARewardedAd) {
        self.rewardedAd = rewardedAd
    }
}

```

## Interstitial advertising

We changed the approach to creating and loading interstitial ads. We now provide the `YMAInterstitialAdLoader` loader object, which loads ads, with the `YMAInterstitialAd` ad object retrieved by the loader's delegate methods. The internal logic of ad loading and rendering remains the same. To learn more about the new API, see the [SDK reference](https://doc-static.yandex.net/src/support/RSYA-RMP/mobile-ads/ru/jazzy/Classes/InterstitialAd.html).

**SDK 5**

```swift
final class InterstitialAdViewController: UIViewController {
   private lazy var interstitialAd: YMAInterstitialAd = {
        let interstitialAd = YMAInterstitialAd(adUnitID: "R-M-XXXXX-YY")
        interstitialAd.delegate = self
        return interstitialAd
    }()

    func loadAd() {
      interstitialAd.load()
    }

    func showAd() {
      interstitialAd.present(from: self)
    }

}
```

**SDK 6**

```swift
final class InterstitialAdViewController: UIViewController {
   private var interstitialAd: YMAInterstitialAd?
   private lazy var interstitialAdLoader: YMInterstitialAdLoader = {
        let loader = YMInterstitialAdLoader()
        loader.delegate = self
        return loader
    }()

    func loadAd() {
      let configuration = YMAAdRequestConfiguration(adUnitID: "R-M-XXXXX-YY")
      interstitialAdLoader.loadAd(with: configuration)
    }

    func showAd() {
      interstitialAd?.show(from: self)
    }

}

extension InterstitialAdViewController: YMAInterstitialAdLoaderDelegate {
   func interstitialAdLoader(_ adLoader: YMAInterstitialAdLoader, didLoad interstitialAd: YMAInterstitialAd) {
        self.interstitialAd = interstitialAd
    }
}
```

Here you can find the complete examples for integrations:

* <!-- source: en/dev/_includes7/github-pubdev-links.md -->
  Link to [GitHub](https://github.com/yandexmobile/yandex-ads-sdk-ios/blob/master/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Interstitial/InterstitialAdViewController.swift).
  <!-- endsource: en/dev/_includes7/github-pubdev-links.md -->

* <!-- source: en/dev/_includes7/github-pubdev-links.md -->
  Link to [GitHub](https://github.com/yandexmobile/yandex-ads-sdk-ios/blob/master/Examples/YandexMobileAdsExample/YandexMobileAdsExample/Yandex/Rewarded/RewardedAdViewController.swift).
  <!-- endsource: en/dev/_includes7/github-pubdev-links.md -->

## App open ad

New ad format added: app open ad. To learn more, see [App open ads](https://ads.yandex.com/helpcenter/en/dev/ios7/app-open-ad.md).

## Minimum iOS version

Yandex Mobile Ads 6.0 requires iOS 13 or higher. If you run an earlier iOS version, please upgrade to iOS 13.

## Yandex Mediation

{% note warning %}

Make sure to update your used [Yandex Mediation](https://ads.yandex.com/helpcenter/en/dev/ios7/list-network.md) adapters and [adapters for third-party mediation networks](https://ads.yandex.com/helpcenter/en/dev/ios7/third-party-mediation.md) to the latest version. Older versions may cause adapter integration errors that can prevent your ads from being served.

{% endnote %}

### New adapter versions

**Current versions of Yandex Mediation adapters (as of SDK 6.0.0 release):**

* Digital Turbine (ex. AdColony): 4.9.0.5.
* AppLovin: 11.11.2.0.
* Chartboost: 9.4.0.0.
* Google: 10.9.0.0.
* InMobi: 10.5.5.1.
* IronSource: 7.4.0.0.
* Mintegral: 7.4.0.2.
* VK Ads (ex. myTarget): 5.18.0.1.
* Start.io: 4.10.0.0.
* Unity Ads: 4.8.0.1.

**Current versions of adapters for third-party mediation platforms (as of SDK 6.0.0 release):**

* Google AdMob (ex. AdMob): 10.9.0.
* IronSource: 7.4.0.

### Renaming the Google AdMob (ex. AdMob) adapter

We renamed the `AdMobYandexMobileAdsAdapters`  adapters as `GoogleYandexMobileAdsAdapters`. If you use the standardized mediation build, you don't have to do anything. If you add the adapters manually, you need to edit your project's Podfile.

#|
|| **SDK 5**
```bash
pod 'AdMobYandexMobileAdsAdapters'
```
| **SDK 6**
```bash
pod 'GoogleYandexMobileAdsAdapters'
```
||
|#
