iOS SDK Upgrade: Difference between revisions

From Engineering Client Portal

(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...")
 
(Import)
Tag: Replaced
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
__NOTOC__
__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 also the option to upgrade with the standalone SDK download.
= How to install the Nielsen App SDK using Cocoapods =
= 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.
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. Please see [[Digital_Measurement_iOS_Cocoapods_Guide]] for instructions.


== Initial Configuration ==
=== Appsdk Suffix Reference ===
The Nielsen SDK integration requires Cocoapods.   
The Nielsen AppSDK has various configurations per market and distribution type, which can be determined by reviewing the [[Digital Measurement iOS Suffix Guide|sdk suffix]].  The first part will be the SDK version: 3 digits for the major SDK version and 1 digit for the minor SDK version. EG: <code>ai.8.1.0.0_abc</code>
* 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 [https://guides.cocoapods.org/using/getting-started.html Getting Started] page, and how to set up the Podfile is mentioned in [https://guides.cocoapods.org/using/using-cocoapods.html Using Cocoapods] page.
=== Additional Resources ===


== Repository Credentials ==
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.
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>
<br>
<br>
<blockquote>
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] Please do not upload any file to github or bitbucket containing the credentials above.
This will automatically lock your access.
</blockquote>
=== 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 ==
=== Dynamic Framework (Cocoapods 1.6.1+) ===
If using '''Dynamic Framework''' (preferred approach), from the command line, type the following:
<syntaxhighlight lang=Javascript>
pod repo add NielsenAppSDK https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs-dynamic.git
</syntaxhighlight>
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:
==== Podfile ====
<syntaxhighlight lang=Javascript>
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
</syntaxhighlight>
=== For Static Framework (Cocoapods 1.4+) ===
From the command line, type the following:
<syntaxhighlight lang=Javascript>
pod repo add NielsenAppSDK https://github.com/nielsendigitalsdk/nielsenappsdk-ios-specs.git
</syntaxhighlight>
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:
==== Podfile ====
<syntaxhighlight lang=Javascript>
platform :ios, '11.0'
source 'https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs.git'
target 'YourProjectsNameHere' do
    #Pods for ApplicationTarget
    pod 'NielsenAppSDK'
end
</syntaxhighlight>
''NOTE: You can have multiple pods within the Podfile''
== Execute Install ==
Once that has been edited, you can now execute the install:
<syntaxhighlight lang=Swift>
pod install
</syntaxhighlight>
<br>
<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:
* NielsenAppSDK
* 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.
= How to install the Nielsen App SDK using latest downloaded version of SDK =
# Download the latest SDK version: [https://nielsendownloads.digitalengsdk.com/digital/Nielsen-iOS-App-SDK-Global_latest.zip iOS SDK Download]
# Unzip the downloaded file. The framework will be under '''StaticFramework'''. Note: there are multiple sample builds to reference included in this download.
# Remove any reference to the old Nielsen framework in Xcode project (typically under ''Frameworks''). Drag & Drop new Nielsen SDK framework into project under ''Frameworks''.
# Clean and build project. Make sure no linking errors have occurred.

Latest revision as of 23:23, 10 April 2024

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. Please see Digital_Measurement_iOS_Cocoapods_Guide for instructions.

Appsdk Suffix Reference

The Nielsen AppSDK has various configurations per market and distribution type, which can be determined by reviewing the sdk suffix. The first part will be the SDK version: 3 digits for the major SDK version and 1 digit for the minor SDK version. EG: ai.8.1.0.0_abc

Additional Resources

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