Upsight logo Back to top

Upsight Ad Mediation

Prerequisites


Setting Up Upsight Ad Mediation

In order to set up the Upsight Ad Mediation SDK, you will need to have Upsight Ad Mediation added to your account and be on SDK version 4.1.1 or later. Contact your customer success manager for more information.

Upsight SDK Integration

Upsight Ad Mediation can only be used in conjunction with the base Upsight SDK and will show rewarded and non-rewarded video ads through billboards and milestones. Make sure you have completed the basic integration of the Upsight SDK including billboards and milestones before you begin integrating Upsight's Ad Mediation SDK.

Cocoapods


The Upsight Ad Mediation SDK can be installed via cocoapods. Before running a pod install inside your terminal, make sure you have Git LFS installed. This is required to for cocoapods to properly fetch our mediation framework. For instructions on how to install Git LFS, please refer to this page: https://help.github.com/articles/installing-git-large-file-storage/

Once Git LFS is installed, run a pod install inside your terminal, or from CocoaPods.app.

After Git LFS is installed, simply add pod 'UpsightAdMediation', '~> 2.11.1' similar to the following in your Podfile:

target 'MyApp' do
  pod 'UpsightAdMediation', '~> 2.11.1'
end

You will also have to add the following to your Info.plist for iOS 10 as some ad networks access these features:

<key>NSCalendarsUsageDescription</key>
<string>Advertisement would like to create a calendar event.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Advertisement would like to store a photo.</string>
<key>NSCameraUsageDescription</key>
<string>Advertisement would like to use your camera.</string>
<key>NSMotionUsageDescription </key>
<string>Advertisement would like to use motion for interactive ad controls</string>

If you are upgrading from 4.2 or earlier, please ensure you remove libUpsightMediation.a as it is no longer required.

Once this is complete, you can proceed to the Showing Mediated Video Ads section.

Manual Integration


Downloading the SDK

Before staring the integration, you'll need to download the latest Upsight Ad Mediation Framework. You can download the iOS version here.

Importing

After downloading, import the Upsight Ad Mediation Framework by dragging and droppingUpsightMediation.framework into your project.

If you have a previous version of Upsight Mediation, you will have to remove the following files when upgrading:

UpsightAdMediation.h
UpsightAdMediationDefinitions.h
libUpsightMediationAds.a
libUpsightMediation.a (4.2 and below)

Project Configuration

Required Frameworks

The Upsight Ad Mediation SDK requires these frameworks to be included in addition to the base frameworks required by the Upsight SDK:

  1. SafariServices.framework (weak link)
  2. Accelerate.framework
  3. AudioToolbox.framework
  4. AVFoundation.framework
  5. CoreGraphics.framework
  6. CoreLocation.framework
  7. CoreMedia.framework
  8. EventKit.framework
  9. EventKitUI.framework
  10. Foundation.framework
  11. GameKit.framework
  12. iAd.framework
  13. libsqlite3.tbd
  14. libxml2.tbd
  15. libz.tbd
  16. MediaPlayer.framework
  17. MessageUI.framework
  18. MobileCoreServices.framework
  19. QuartzCore.framework
  20. Social.framework (weak link)
  21. StoreKit.framework
  22. SystemConfiguration.framework
  23. Twitter.framework
  24. UIKit.framework
  25. WebKit.framework
  26. GLKit.framework
  27. CoreMotion.framework
  28. JavascriptCore.framework (weak link)
  29. WatchConnectivity.framework (weak link)

Disabling ATS and BitCode

AppTransportSecurity

Some of the ad network SDKs used by the Upsight Ad Mediation SDK do not support sending their data over HTTPS. If you are building on XCode 7, you must turn off App Transport Security by adding an additional dictionary item to your Info.plist. To so, add a dictionary item in your Info.plist called NSAppTransportSecurity with a boolean item NSAllowsArbitraryLoads set to YES. You can view more information this specific setting on Apple's documentation website.

BitCode

While the Upsight and UpsightAdMediation SDK are built with bitcode enabled, some of the included ad network libraries have not yet enabled bitcode. You can manually disable bitcode in your application by going to the Build Options in your target's build settings and setting Enable Bitcode to No.

iOS 10 Privacy Settings

With the release of iOS10, Apple made it a requirement to define the usage description for references to classes that are associated with permission-related objects. Some networks that are mediated make use of these permissions. For your submitted app to be approved, the following entries must be added to your Info.plist:

<key>NSCalendarsUsageDescription</key>
<string>Advertisement would like to create a calendar event.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Advertisement would like to store a photo.</string>
<key>NSCameraUsageDescription</key>
<string>Advertisement would like to use your camera.</string>
<key>NSMotionUsageDescription </key>
<string>Advertisement would like to use motion for interactive ad controls</string>

Showing Mediated Video Ads


Non Rewarded Video Ads & Static Interstitials

Once you have added the SDK, you will be able to show a mediated video ad or static interstitial at any billboard. Simply go to your Upsight Dashboard and create an Ad Campaign targeting a specific milestone. See the Creating Mediated Ad Campaigns section for more information.

Rewarded Video Ads

Simply implement handling rewards and you will be able to grant your users rewards when running a Rewarded Video Ad campaign at any billboard for a given milestone scope.

Make sure to add the rewards to the dashboard. See Adding Rewards for more information.