iOS SDK Upgrade

From Engineering Client Portal

Revision as of 16:23, 10 June 2020 by LaMarHolmes (talk | contribs) (Created page with "__NOTOC__ = iOS SDK Upgrade Guide = This guide shows how to upgrade Nielsen's iOS SDK. The preferred method is through the artifactory method with '''Cocoapods'''. There is a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

iOS SDK Upgrade Guide

This guide shows how to upgrade Nielsen's iOS SDK. The preferred method is through the artifactory method with Cocoapods. There is also the option to upgrade with the standalone SDK download.

How to install the Nielsen App SDK using Cocoapods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects. It has over 30 thousand libraries and is used in over 1.9 million apps. The Nielsen SDK now uses this distribution framework for improved version management and provides a Static and Dynamic Framework.

Initial Configuration

The Nielsen SDK integration requires Cocoapods.

  • The Dynamic Framework which requires Cocoapods Version 1.6.1 or higher.
  • The Static Framework requires Cocoapods version 1.4.0. or higher.

The full installation guide for this framework is provided on the Getting Started page, and how to set up the Podfile is mentioned in Using Cocoapods page.

Repository Credentials

The first step is to add the credentials received from Nielsen into your .netrc file. Navigate to your home folder and create a file called .netrc

cd ~/
vi .netrc

Within this file you need to add your credentials in the following format:

machine raw.githubusercontent.com
login <Nielsen App SDK client>
password <Auth token>


AlertIcon.png

Please do not upload any file to github or bitbucket containing the credentials above.

This will automatically lock your access.

Credentials

Obtain credentials → here ←

Verify version of Cocoapods

First verify that Cocoapods is installed.

pod --version

If it is not, then install.

Install via gem
sudo gem install cocoapods
Install using homebrew
brew install cocoapods

Add Cocoapod repository

Dynamic Framework (Cocoapods 1.6.1+)

If using Dynamic Framework (preferred approach), from the command line, type the following:

pod repo add NielsenAppSDK https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs-dynamic.git

Make sure you run the pod init command in your **project's directory.**

pod init


You now need to slightly modify the PodFile that was created in this directory. From the command line, you can use vi or vim to edit.
The following must be in the PodFile:

Podfile

platform :ios, '11.0'
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs-dynamic.git'

target 'YourProjectsNameHere' do
 use_frameworks!
    #Pods for ApplicationTarget
    pod 'NielsenAppSDK'
end

For Static Framework (Cocoapods 1.4+)

From the command line, type the following:

pod repo add NielsenAppSDK https://github.com/nielsendigitalsdk/nielsenappsdk-ios-specs.git

Make sure you run the pod init command in your **project's directory.**

pod init


You now need to slightly modify the PodFile that was created in this directory. From the command line, you can use vi or vim to edit.
The following must be in the PodFile:

Podfile

platform :ios, '11.0'
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'

target 'YourProjectsNameHere' do
    #Pods for ApplicationTarget
    pod 'NielsenAppSDK'
end

NOTE: You can have multiple pods within the Podfile

Execute Install

Once that has been edited, you can now execute the install:

pod install


Cocoapods will automatically create a new file with extension “.xcworkspace”. From this moment, that file should be used for using the target project instead of previous one with extension “.xcodeproj”. Inside of this workspace you will see “Pods” target which will include ready to use NielsenAppApi framework.

Open the file with the extension of .xcworkspace file using Xcode.

Pod Versions

The following Pod versions are now available:

  • NielsenAppSDK
  • NielsenTVOSAppSDK
  • VRIAppSDK

Regional Builds

  • NielsenAGFAppSDK
  • NielsenAGFTVOSAppSDK
  • NielsenAGFNoAdAppSDK
  • NielsenAGFNoAdTVOSAppSDK


Additional Resources

For more information on CocoaPods or How to set up the Profile in the Using Cocoapods page.

How to install the Nielsen App SDK using latest downloaded version of SDK

  1. Download the latest SDK version: iOS SDK Download
  2. Unzip the downloaded file. The framework will be under StaticFramework. Note: there are multiple sample builds to reference included in this download.
  3. Remove any reference to the old Nielsen framework in Xcode project (typically under Frameworks). Drag & Drop new Nielsen SDK framework into project under Frameworks.
  4. Clean and build project. Make sure no linking errors have occurred.