Difference between revisions of "Digital Measurement iOS Artifactory Guide"

From Engineering Client Portal

 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR Video iOS SDK}} {{CurrentBreadcrumb}}
+
{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|Digital Downloads}} {{CurrentBreadcrumb}}
 
[[Category:Digital]]
 
[[Category:Digital]]
  
 
__NOTOC__
 
__NOTOC__
The Nielsen AppSDK can either be downloaded directly or can be integrated directly within an application through the use of a CocoaPod or Gradle.
+
The Nielsen AppSDK can either be downloaded directly or integrated with a supported Dependency Manager.
  
== How to install Nielsen SDK in iOS  ==
+
= Nielsen SDK Dependency Managers for iOS =
 +
The Nielsen SDK currently supports three different dependency managers. 
 +
* '''[[Digital_Measurement_iOS_Cocoapods_Guide|CocoaPods]]''' -  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 Dynamic Framework which requires Cocoapods Version 1.6.1 or higher.
 +
** The Static Framework requires Cocoapods version 1.4.0. or higher.
  
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.  
+
* '''[[Digital Measurement iOS Carthage Guide|Carthage]]''' - a simple dependency manager for macOS and iOS, created by a group of developers from GitHub. Carthage is intended to be the simplest way to add frameworks to your Cocoa application. Carthage builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Please note: Carthage does not automatically modify your project files or your build settings.
  
=== Initial Configuration ===
+
* '''[[Digital Measurement iOS Swift Package Manager Guide|The Swift Package Manager]]''' is available as a part of the Xcode application for MacOS. We recommend to use the Xcode version 12.x with Swift 5.3 that is the minimum required version of Swift with binary dependencies support. Apple Xcode can be downloaded and installed using Mac App Store application or from the Apple web site (https://developer.apple.com/account) in the Downloads section.
The Nielsen SDK integration requires Cocoapods 1.4.0. or higher. The full installation guide for this framework is provided on the [https://guides.cocoapods.org/using/getting-started.html Getting Started] page. How to set up the Podfile is mentioned in [https://guides.cocoapods.org/using/using-cocoapods.html) 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
 
<syntaxhighlight lang=Swift>
 
cd ~/
 
vi .netrc
 
</syntaxhighlight>
 
 
 
Within this file you need to add your credentials in the following format:
 
<syntaxhighlight lang=Javascript>
 
machine raw.githubusercontent.com
 
login <Nielsen App SDK client>
 
password <Auth token>
 
</syntaxhighlight>
 
 
 
=== Credentials ===
 
Obtain credentials '''[[Digital Downloads| → here ←]]'''
 
 
 
=== Verify version of Cocoapods ===
 
First verify that Cocoapods is installed.
 
<syntaxhighlight lang=Javascript>
 
pod --version
 
</syntaxhighlight>
 
If it is not, then install.<br >
 
===== Install via gem =====
 
<syntaxhighlight lang=Javascript>
 
sudo gem install cocoapods
 
</syntaxhighlight>
 
===== Install using homebrew =====
 
<syntaxhighlight lang=Javascript>
 
brew install cocoapods
 
</syntaxhighlight>
 
=== Add Cocoapod repository ===
 
From the command line, type the following:
 
<syntaxhighlight lang=Javascript>
 
pod repo add NielsenAppSDK https://github.com/nielsendigitalsdk/nielsenappsdk-ios-specs.git
 
</syntaxhighlight>
 
<br>
 
Make sure you run the pod init command in your **project's directory.**
 
 
 
<syntaxhighlight lang=Javascript>
 
pod init
 
</syntaxhighlight>
 
<br>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. <br> The following must be in the PodFile:
 
==== Objective C ====
 
 
 
<syntaxhighlight lang=Javascript>
 
platform :ios, '11.0'
 
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'
 
 
 
target 'YourProjectsNameHere' do
 
    #Pods for ApplicationTarget
 
    pod 'NielsenAppSDK'
 
</syntaxhighlight>
 
 
 
==== Swift ====
 
 
 
If your pod has '''use_frameworks!''' and you are developing in Swift, please use the following:
 
 
 
<syntaxhighlight lang=javascript>
 
# 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
 
 
 
</syntaxhighlight>
 
<br>
 
An example Podfile without '''use_frameworks!:'''
 
<syntaxhighlight lang=Javascript>
 
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
 
</syntaxhighlight>
 
 
 
=== Execute Install ===
 
Once that has been edited, you can now execute the install:
 
<syntaxhighlight lang=Swift>
 
pod install
 
</syntaxhighlight>
 
<br>
 
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 <code>.xcworkspace</code> 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 [https://guides.cocoapods.org/using/getting-started.html) CocoaPods] or How to set up the Profile in the [https://guides.cocoapods.org/using/using-cocoapods.html) Using Cocoapods] page.
 
<br>
 
<br>
 

Latest revision as of 03:59, 17 December 2020

Engineering Portal breadcrumbArrow.png Digital breadcrumbArrow.png Digital Downloads breadcrumbArrow.png Digital Measurement iOS Artifactory Guide


The Nielsen AppSDK can either be downloaded directly or integrated with a supported Dependency Manager.

Nielsen SDK Dependency Managers for iOS

The Nielsen SDK currently supports three different dependency managers.

  • CocoaPods - 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 Dynamic Framework which requires Cocoapods Version 1.6.1 or higher.
    • The Static Framework requires Cocoapods version 1.4.0. or higher.
  • Carthage - a simple dependency manager for macOS and iOS, created by a group of developers from GitHub. Carthage is intended to be the simplest way to add frameworks to your Cocoa application. Carthage builds your dependencies and provides you with binary frameworks, but you retain full control over your project structure and setup. Please note: Carthage does not automatically modify your project files or your build settings.
  • The Swift Package Manager is available as a part of the Xcode application for MacOS. We recommend to use the Xcode version 12.x with Swift 5.3 that is the minimum required version of Swift with binary dependencies support. Apple Xcode can be downloaded and installed using Mac App Store application or from the Apple web site (https://developer.apple.com/account) in the Downloads section.