Adverts with Google IMA

To test this feature and view the example code, please see the Apple (FPS) Example Code Quick Start guide.

You can extend the CONNECT Player SDK for FPS to support the insertion of linear adverts using the third-party component IMAWrapper for the Google Interactive Media Ads (IMA) framework.

Adverts are only supported on iOS (Google do not provide an IMA framework for tvOS).

Prerequisites

  • An advert server already configured and knowledge of the advert tag URLs that will be used to access it.
  • An understanding of the CocoaPods technology, see Using CocoaPods.

Procedure

The process is split into two stages:

  • Installing IMA CocoaPods
  • Enabling playback of linear adverts

Installing the IMA CocoaPods pod

To carry out a pod integration from scratch, begin at step 1. If you are using the dynamic-ads-ima example application, start at step 3 as the pod file is already present.

  1. Install cocoapods by running the following command:

    sudo gem install cocoapods
    
  2. Create your app's podfile in the project's root folder by running pod init and add the IMA pod dependency, which should look something like this:

    target '<target_name>' do
    use_frameworks!
    source 'https://github.com/CocoaPods/Specs.git'
    platform :ios, '9.0'
    pod 'GoogleAds-IMA-iOS-SDK', '~> 3.9'
    end
    
  3. To apply this into your project, execute the following command in the project's root folder (where the Xcode project file is located):

    pod install  --repo-update
    

    The --repo-update switch is only required if you need the pod details to be reflected into the corresponding project workspace files, for example, the first time it is run.

There will now be a .xcworkspace configured with the IMA Pod linking capability; use this instead of the .xcodeproj.

Next step: Enable playback of linear adverts