MoPub iOS SDK

This guide explains how to integrate Smaato third-party ads through the MoPub Mediation SDK for iOS platforms.

Initializing

All libraries need to be explicitly initialized. Please consult the corresponding MoPub integration guide:

iOS Initialization

We also allow for usage through a MoPub account via custom events. Follow the respective instructions below.

Integrating Ad Formats

Here you will find the ad format documentation for integrating Smaato as a secondary network with MoPub.

Banner Ads

1. Add a Custom Native Network under Networks in your MoPub account (click New Network)

  1. Name your Network (e.g., Smaato).
  2. Under App & ad unit setup, configure your ad units by entering the values as seen below.
  3. Then, enter the values of your Publisher ID and Adspace ID by replacing the “0“).

2. Add the SOMAMoPubBannerAdapter.h and SOMAMoPubBannerAdapter.m files to your project. These are included in the SDK ZIP folder.

// UNCOMMENT THE LINES FIRST
//self.somaBanner.adSettings.publisherId = 0;
//self.somaBanner.adSettings.adSpaceId = 0;

Interstitial Ads

1. Add a Custom Native Network under Networks in your MoPub account (click New Network)

  • Name your network (e.g. Smaato).
  • Under “App & ad unit setup”, configure your ad units by entering values as seen below.
  • Then, enter the values of your Publisher ID and Adspace ID by replacing the “0“).

2. Add the SOMAMoPubInterstitialAdapter.h and SOMAMoPubInterstititalAdapter.m files to your project. These are included in the SDK .ZIP folder.

// UNCOMMENT THE LINES FIRST
//self.somaBanner.adSettings.publisherId = 0;
//self.somaBanner.adSettings.adSpaceId = 0;

Native Ads

MoPub native ads can now be mediated to show Smaato ads by using MoPub custom event settings on their dashboard along with Smaato adapters. Here’s how:

  1. Create a Custom Native Network on the MoPub dashboard.
  2. Enter SOMAMoPubNativeCustomEvent in the field CUSTOM EVENT CLASS.
  3. Enter {"pub":"0","ad":"3075"} in the CUSTOM EVENT CLASS DATA field. This will show a demo native ad from Smaato. Please update it according to your Publisher ID and Adspace ID.

Now, for configuring your iOS Application:

  1. Add the MoPub SDK and display a native ad unit.
  2. Add the Smaato iOS SDK into the project.
  3. Add the SOMAMoPubAdapter/Native folder to the project. This is available in the Smaato iOS SDK folder once you unzip the downloaded SDK.
  4. Edit the SOMAMoPubNativeCustomEvent.m class if you need any customization. 

MoPub offers two integration methods: adplacer feature and manual setup. Note that setting supportedCustomEvents with SOMAMoPubNativeCustomEvent is mandatory for both approaches.

Interstitial Video Ads

MoPub publishers can now mediate Smaato to show video interstitial ads by using Smaato adapters on their MoPub dashboard. Here’s how:

  1. Create a Custom Native Network on the Mopub dashboard.
  2. Enter SOMAMoPubVideoInterstitialAdapter in the field CUSTOM EVENT CLASS.
  3. Enter {"pub":"0","ad":"3090"} in the CUSTOM EVENT CLASS DATA field. This will show a demo interstitial video ad from Smaato. Please update it according to your Publisher ID and Adspace ID.

Now, for configuring your iOS Application:

  1. Add the MoPub SDK and display interstitial video ad unit.
  2. Add the Smaato iOS SDK into the project and follow the instructions as stated above
  3. Add the SOMAMoPubAdapter/VideoInterstitial folder to the project. This is available in the Smaato iOS SDK folder once you unzip the downloaded SDK.
  4. Edit the SOMAMoPubVideoInterstitialAdapter.h/.m class if you need any customization.

Rewarded Video Ads

MoPub publishers can now mediate Smaato to show rewarded video ads by using Smaato adapters on their Mopub dashboard. Here’s how:

  1. Create a Custom Native Network on the MoPub dashboard.
  2. Enter SOMAMoPubRewardedVideoAdapter in the field CUSTOM EVENT CLASS.
  3. Enter {"pub":"0","ad":"3090"} in the CUSTOM EVENT CLASS DATA field. This will show a demo Rewarded video ad from Smaato. Please update it according to your publisher id and Adspace ID.

Now, for configuring your iOS Application:

  1. Add the MoPub SDK and display Rewarded Video ad unit.
  2. Add the Smaato iOS SDK into the project and follow the instructions as stated above
  3. Add the SOMAMoPubAdapter/RewardedVideo folder to the project. This is available in the Smaato iOS SDK folder once you unzip the downloaded SDK.
  4. Edit the SOMAMoPubRewardedVideoAdapter.h/.m class if you need any customization.

Modified: November 6, 2019 at 4:57 pm