Digital Measurement iOS Artifactory Guide

From Engineering Client Portal

Revision as of 19:45, 12 December 2019 by ColinBrown (talk | contribs) (Podfile)

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png DCR & DTVR breadcrumbArrow.png Digital Measurement iOS Artifactory Guide

The Nielsen AppSDK can either be downloaded directly or can be integrated directly within an application through the use of a CocoaPod or Gradle.

How to install Nielsen SDK in iOS

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

To select a specific version of the Nielsen SDK, just append the build number. For example, this line is requesting build 7.1.0.0:

pod 'NielsenAppSDK','7.1.0.0'


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.