---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/ios/quick-start.md
  - https://ads.yandex.com/helpcenter/ru/dev/ios/quick-start.md
  - https://ads.yandex.com/helpcenter/zh/dev/ios/quick-start.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/en/llms.txt

# Mobile Ads SDK integration

> _System: YAN, Adfox_

Integrating the Yandex Mobile Ads SDK into your app is the first step toward serving ads and generating revenue. After integrating the SDK, you can choose an ad format for your app monetization (for example, banner ads or rewarded ads) and perform its setup.


## Prerequisites {#prolog}

To prepare your app, follow the steps described in the next sections.

### App requirements {#requirements}

- Use iOS 13 or higher.
- Use Xcode 16.4 or higher.

### Setting up the app in your Yandex Advertising Network account {#yan}

<!-- source: en/dev/_includes/reg.md -->
Here's how to register your app in the Yandex Advertising Network:

1. [Log in](https://partner.yandex.com/) or [register](https://passport.yandex.ru/auth/list?origin=rsy_ligth_in&retpath=https%3A%2F%2Fpartner.yandex.ru%2Fform%2F?roles%5B%5D=27) your account in the Yandex Advertising Network.
2. [Register](https://passport.yandex.ru/auth/list?origin=rsy_ligth_in&retpath=https%3A%2F%2Fpartner.yandex.ru%2Fform%2F?roles%5B%5D=27) your app in the Yandex Advertising Network.
<!-- endsource: en/dev/_includes/reg.md -->

## Integration

Integration of the Yandex Mobile Ads SDK involves the following steps:

1. Integrating the Yandex Mobile Ads SDK.
2. SKAdNetwork support.
3. Initializing the library.
4. Testing the integration.

### Integrating the Yandex Mobile Ads SDK

There are two ways to integrate the Yandex Mobile Ads SDK into your project:

* **CocoaPods (recommended)**: Easier integration and support for Mobile Mediation.
* **Swift Package Manager**: For projects that use only SPM. Mobile Mediation is also supported.

{% list tabs %}

- CocoaPods

  Add the `YandexMobileAds` library to your Podfile. If you use InStream ads, make sure to also add the `YandexMobileAdsInstream` pod.

  ```
  pod 'YandexMobileAds', '8.3.0'
  pod 'YandexMobileAdsInstream', '0.74.0'
  ```

- Swift Package Manager

  1. In your Xcode project, add a dependency using **File** → **Add Packages dependencies**.
  2. Specify the URL of the repository with the Swift package: `https://github.com/yandexmobile/yandex-ads-sdk-ios`.
    <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/spm-link-repository.png">
  3. Go to **Build Settings** and add the parameter value `Other Linker Flags = -ObjC` under **Linking**.
     <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/spm-build-settings.png">
  4. Make sure the target is linked to YandexMobileAdsPackage. If it isn't linked, go to **Link Binary With Libraries** and add a link to the library by clicking **+**.
     <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/target-link-spm-new.png">
  5. Select the adapters or the mediation build. The core build only includes those adapters that are available in SPM.
     <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/spm-adapters.png">


{% endlist %}

### SKAdNetwork support {#skad}

Add ad network identifiers to your app's `Info.plist` file. For instructions, see [SKAdNetwork](https://ads.yandex.com/helpcenter/en/dev/ios/skadnetwork.md).

### Initializing the {#init} library

Successfully initializing the Yandex Mobile Ads SDK is a prerequisite for correctly integrating the library. By default, the SDK is initialized automatically before ads are rendered. However, manual initialization can speed up the rendering of the first ad, thereby increasing your monetization revenue.

#### Manual SDK initialization

You can initialize the library manually using the `YandexAds.initializeSDK()` method.
We recommend adding the initialization code to the `func application(_ application: didFinishLaunchingWithOptions launchOptions:)` method of the `AppDelegate` class.

```swift
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        YandexAds.initializeSDK(completionHandler: completionHandler)
        return true
    }
}
```

## Testing SDK integration

<!-- source: en/dev/_includes/test-ios.md -->
You can check the logs to make sure your SDK integration is correct.

To view logs, go to the Console tool and set `Subsystem = com.mobile.ads.ads.sdk`. You can filter logs by category, leaving only the ones related to the ad SDK integration. Set `Category = Integration`. Save the query and select it from the filter line whenever you need debugging.

You will see messages about successful integration: enabling `YandexMobileAdsBundle.bundle`, initializing the SDK, and connecting SKAdNetwork and mobile mediation adapters (if you use them in your project).

If there are any problems during SDK integration, you will see a detailed issue report.

<img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/common/integration-ios.png">
<!-- endsource: en/dev/_includes/test-ios.md -->

## Next steps

Once you've successfully integrated the Yandex Mobile Ads SDK, you can proceed to implementing your ad formats.

Select one of the following types of ads that best suits your app:



#|
|| **Ad format** | **YAN** | **Adfox** | **Description** ||
|| [Adaptive inline banner](https://ads.yandex.com/helpcenter/en/dev/ios/adaptive-inline-banner.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | 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. ||
|| [Adaptive sticky banner](https://ads.yandex.com/helpcenter/en/dev/ios/adaptive-sticky-banner.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | An adaptive sticky banner is a small, automatically updated ad placed at the bottom or top of the app screen. It doesn't overlap the main 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. ||
|| [Interstitial ads](https://ads.yandex.com/helpcenter/en/dev/ios/interstitial.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | Interstitial advertising is a full-screen ad format embedded within the app content during natural pauses, such as transitioning between game levels or completing a target action.

When users see interstitial ads, their attention is entirely focused on the ads, which results in a higher cost for such impressions.

Overuse of this format can worsen user interaction. ||
|| [Rewarded ads](https://ads.yandex.com/helpcenter/en/dev/ios/rewarded.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/no-new.png"> | Rewarded ads are a popular fullscreen ad format where users receive incentives for viewing ads.

<!-- source: en/dev/_includes/rewarded.md -->
Ad impressions are opt-in: for example, users can initiate them to get game bonuses or extra lives.
<!-- endsource: en/dev/_includes/rewarded.md -->

Strong user motivation makes this ad format the most popular and profitable adoption in free apps.
 ||
|| [Native ads](https://ads.yandex.com/helpcenter/en/dev/ios/native.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | Native advertising is an ad type where the layout can be defined on the app side. This feature allows you to change the visual style of ads and their placement, considering the app design specifics.

<!-- source: en/dev/_includes/native-ads.md -->
Ad rendering is performed with native platform tools, which enhances ad performance and quality.
<!-- endsource: en/dev/_includes/native-ads.md -->

You can set the layout of your native ads using a template or manually. If you choose to use a template, the ad layout will be set on the SDK side. ||
|| [App open ads](https://ads.yandex.com/helpcenter/en/dev/ios/app-open-ad.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/no-new.png"> | App open ads are a special ad format for monetizing app load screens. These ads can be closed at any time and are designed to be served:
* When the app is launched.
* When the app is brought to the foreground.
* When returning to the app from the background.
 ||
|| [Ad feed](https://ads.yandex.com/helpcenter/en/dev/ios/feed-ad.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/no-new.png"> | Ad feeds are units that consist of a sequence of ads. Feeds can be added to your app as its main content, or they may come after the existing content. Feeds may contain dozens of ads, which are loaded sequentially (several ads are loaded at once).
 ||
|| [InStream ads](https://ads.yandex.com/helpcenter/en/dev/ios/instream.md) | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | <img src="https://yastatic.net/s3/doc-binary/src/dev/mobile-ads/ru/images/yes-new.png"> | InStream is an ad format that lets you monetize your app by serving ads while video content is playing.

An InStream ad consists of a scenario with multiple video blocks. The type of video unit in an InStream scenario determines how the video ad should be played relative to the main video content.
 ||
|#
