Digital Measurement iOS Artifactory Guide: Difference between revisions
From Engineering Client Portal
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb| | {{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR Video iOS SDK}} {{CurrentBreadcrumb}} | ||
[[Category:Digital]] | [[Category:Digital]] | ||
Revision as of 00:15, 12 February 2019
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.
Initial Configuration
The Nielsen SDK integration requires Cocoapods 1.4.0. or higher. The full installation guide for this framework is provided on the Getting Started page. 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>
Your Credentials are:
machine raw.githubusercontent.com
login NielsenSdkRepo
password edec0d01b953171c704188c1d8fc0aa4217ec506
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
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:
Objective C
platform :ios, '11.0'
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'
target 'YourProjectsNameHere' do
#Pods for ApplicationTarget
pod 'NielsenAppSDK'
Swift
If your pod has use_frameworks! and you are developing in Swift, please use the following:
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'
target 'YourProjectsNameHere' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
#Pods for ApplicationTarget
pod 'NielsenAppSDK'
static_frameworks = ['NielsenAppSDK']
# make all the other frameworks into static frameworks by overriding the static_framework? function to return true
pre_install do |installer|
installer.pod_targets.each do |pod|
if static_frameworks.include?(pod.name)
puts "Overriding the static_framework? method for #{pod.name}"
def pod.static_framework?;
true
end
end
end
end
end
An example Podfile without use_frameworks!:
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'
platform :ios, '9.0'
target 'Application' do
# Uncomment the next line if you're using Swift
# or would like to use dynamic frameworks
# use_frameworks!
# Pods for Application
pod 'NielsenAppSDK'
end
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:
- 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.