Review client-side upgrade

  • The tvOS SDK v4 introduces IMAAdDisplayContainer, aligning it with the iOS SDK.

  • Upgrading from v3 involves changing the module name from ClientSideInteractiveMediaAds to GoogleInteractiveMediaAds.

  • You must now create and utilize an IMAAdDisplayContainer when making ad requests.

The Client-side tvOS SDK has changed very little with the v4 release. The primary change is the addition of IMAAdDisplayContainer, as seen in the iOS SDK.

This guide walks through the process required to upgrade an existing v3 implementation to the new v4 SDK.

Change the module name

To match the iOS SDK, we've changed the module name from ClientSideInteractiveMediaAds to GoogleInteractiveMediaAds, so you should make the following changes.

Changes
Old
#import <ClientSideInteractiveMediaAds/ClientSideInteractiveMediaAds.h>
@import ClientSideInteractiveMediaAds;
New
#import <GoogleInteractiveMediaAds/GoogleInteractiveMediaAds.h>
@import GoogleInteractiveMediaAds;

Create the new ad container

Create and pass in an IMAAdDisplayContainer
Old
IMAAdsRequest *adsRequest =
    [[IMAAdsRequest alloc] initWithAdTagUrl:kAdTagUrlString
                         adDisplayContainer:self.videoView
                            contentPlayhead:self.contentPlayhead
                                userContext:userContext];
New
self.adDisplayContainer =
    [[IMAAdDisplayContainer alloc] initWithAdContainer:self.videoView];
IMAAdsRequest *adsRequest =
    [[IMAAdsRequest alloc] initWithAdTagUrl:kAdTagUrlString
                         adDisplayContainer:self.adDisplayContainer
                            contentPlayhead:self.contentPlayhead
                                userContext:userContext];