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

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

App requirements

  • Use iOS 13 or higher.
  • Use Xcode 16.1 or higher.

Setting up the app in your Boost account

Here's how to register your app in the Boost:

  1. Log in in the Boost.
  2. Register your app in the Boost.

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.

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

pod 'YandexMobileAds', '8.0.0'
pod 'YandexMobileAdsInstream', '0.70.0'
  1. In your Xcode project, add a dependency using FileAdd Packages dependencies.
  2. Specify the URL of the repository with the Swift package: https://github.com/yandexmobile/yandex-ads-sdk-ios.
  3. Go to Build Settings and add the parameter value Other Linker Flags = -ObjC under Linking.
  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 +.
  5. Select the adapters or the mediation build. The core build only includes those adapters that are available in SPM.

SKAdNetwork support

Add ad network identifiers to your app's Info.plist file. For instructions, see SKAdNetwork.

Initializing the 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.

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

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.

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

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

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

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

Rewarded ads are a popular fullscreen ad format where users receive incentives for viewing ads.

Ad impressions are opt-in: for example, users can initiate them to get game bonuses or extra lives.

Strong user motivation makes this ad format the most popular and profitable adoption in free apps.

Native ads

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.

Ad rendering is performed with native platform tools, which enhances ad performance and quality.

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

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

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

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.