Review client-side upgrade

  • The tvOS SDK v4 primarily adds IMAAdDisplayContainer , similar to the iOS SDK.

  • To upgrade from v3 to v4, change the module name from ClientSideInteractiveMediaAds to GoogleInteractiveMediaAds .

  • In v4, create an IMAAdDisplayContainer and pass it into the IMAAdsRequest initialization.

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 
 ]; 
Design a Mobile Site
View Site in Mobile | Classic
Share by: