Add an ad client dependency

Enable Google IMA, Google DAI, and FreeWheel ad requests in your iOS app


👍

IMPORTANT

If you are not using FreeWheel Ad Manager, Google DAI, or Google IMA to serve your ads, skip to Schedule VAST ads.


The JW Player SDK for iOS integrates several ad client SDKs that you can use to request ads:

  • FreeWheel Ad Manager
  • Google DAI
  • Google IMA

To begin using any of the supported ad clients, you must first add the dependency to your app. After you have the items listed in the Requirements section, you can use CocoaPods or a manual (Local) approach to add one or multiple ad client dependencies.


Requirements



Use CocoaPods to add an ad client dependency

👍

IMPORTANT

CocoaPods can only be used for the following ad clients:

• Google DAI (included as part of the Google IMA SDK)
• Google IMA


Edit Podfile

  1. In a text editor, open the Podfile for your app.
  2. Add GoogleAds-IMA-iOS-SDK as a dependency. Be sure to use the version located in the googleIMAVersion property. You can also review this plugin support table.
# Pods for MyAwesomeProject
pod 'JWPlayer-SDK', 'SDK-VERSION-NUMBER'
Pod 'GoogleAds-IMA-iOS-SDK', 'AD-CLIENT-DEPENDENCY-VERSION'
  1. Save Podfile and close the text editor.

Install the SDK

  1. At the terminal prompt of your project directory, enter pod install to install the JW Player SDK for iOS.
  2. Open the .xcworkspace file for your project to launch Xcode.


Manually add an ad client dependency

  1. Download and unzip the ad client SDK.
  2. From within Xcode, expand the project in the navigator.
  3. Drag framework file from those listed in the table below from your desktop into the Frameworks folder in Xcode. In the pop-up screen that appears, be sure to select your target.
Ad clientFramework file
FreeWheel Ad Manager
                                        
AdManager.framework

From your FreeWheel representative, request the FreeWheel Ad Manager SDK for iOS that is bitcode-enabled with dynamic libraries. This table shows the minimum supported FreeWheel SDK version that has been tested for each JW Player iOS SDK version.

In addition, refer to FreeWheel's documentation to ensure that you have added all the listed frameworks.

If you are using Swift instead of Objective-C, use the FreeWheel guide to set up your library.
Google DAI / IMAGoogleInteractiveMediaAds.framework
  1. Click Finish.
  2. Select the target in the project editor.
  3. Click General.
  4. Verify that the added frameworks appear in the Frameworks, Libraries and Embedded Content section. The Embed toggle should be set to Do not embed. If any framework is missing from the list, add it by clicking the + button at the bottom of the section.
  5. (FreeWheel only) Highlight your target and in Build Settings > Linking > Other Linker Flags, add -ObjC. This is required to compile the app against the FreeWheel iOS SDK.


Next step

Now that you have added an ad client dependency, you can now schedule ads for any of the following ad clients:

Did this page help you?