Difference between revisions of "iOS SDK Upgrade"

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...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
= iOS SDK Upgrade Guide =
+
= How to install Nielsen SDK using CocoaPods =
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.
 
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 ==
 
== Initial Configuration ==
 
The Nielsen SDK integration requires Cocoapods.   
 
The Nielsen SDK integration requires Cocoapods.   
 +
* The XCFramework which requires Cocoapods Version 1.10.1 or higher.
 
* The Dynamic Framework which requires Cocoapods Version 1.6.1 or higher.
 
* The Dynamic Framework which requires Cocoapods Version 1.6.1 or higher.
 
* The Static Framework requires Cocoapods version 1.4.0. or higher.
 
* The Static Framework requires Cocoapods version 1.4.0. or higher.
Line 15: Line 13:
 
== Repository Credentials ==
 
== Repository Credentials ==
 
The first step is to add the credentials received from Nielsen into your .netrc file.
 
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>
 
 
<blockquote>
 
<blockquote>
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] Please do not upload any file to github or bitbucket containing the credentials above.
+
[[Image:AlertIcon.png|left|60px|link=|class=smallIcon]] Starting on Sept 21, 2021 the Nielsen SDK has moved to a public repository. Credentials are no longer required.
This will automatically lock your access.
 
 
</blockquote>
 
</blockquote>
=== Credentials ===
+
<br>
Obtain credentials '''[[Digital Downloads| → here ←]]'''
 
  
 
== Verify version of Cocoapods ==
 
== Verify version of Cocoapods ==
Line 50: Line 33:
 
</syntaxhighlight>
 
</syntaxhighlight>
 
== Add Cocoapod repository ==
 
== Add Cocoapod repository ==
 +
=== XCFramework (Cocoapods 1.10.1+) ===
 +
If using '''XCFramework''' (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-XC'
 +
end
 +
</syntaxhighlight>
 +
 +
<blockquote>'''Note''': If you migrate from the iOS dynamic framework to the XCFramework, just add -XC suffix for the pod in the podfile. E.g. NielsenAppSDK should be replaced with NielsenAppSDK-XC. The same Github repo is used for both dynamic and XCFramework.</blockquote>
 +
 +
<blockquote>'''Note''': Nielsen AppSDK clients with applications on TVOS platform should take into account that TVOS slices are now part of the same XCFramework with iOS slices, so the XCFramework name is the same for both iOS and TVOS. But the TVOS framework imported in the application still has TVOS in its name. This is needed to reduce the number of changes in the existing apps. The code below should be added into the podfiles for TVOS XCFramework users.</blockquote>
 +
 +
<syntaxhighlight lang=Javascript>
 +
# modify XCFramework configuration files to update NielsenAppApi.framework -> NielsenTVAppApi.framework
 +
post_install do |installer|
 +
  installer.pods_project.targets.each do |target|
 +
    if target.name == 'Pods-NielsenVideoPlayerTVOSPodsXC'
 +
      # update Pods-NielsenVideoPlayerTVOSPodsXC.debug.xcconfig file
 +
      # update Pods-NielsenVideoPlayerTVOSPodsXC.release.xcconfig file
 +
      target.build_configurations.each do |config|
 +
          xcconfig_path = config.base_configuration_reference.real_path
 +
          puts "post_install: Found #{File.basename(xcconfig_path)}"
 +
          xcconfig = File.read(xcconfig_path)
 +
          new_xcconfig = xcconfig.sub('-framework "NielsenAppApi"', '-framework "NielsenTVAppApi"')
 +
          File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
 +
          puts "post_install: Updated #{File.basename(xcconfig_path)} file with a value: NielsenTVAppApi.framework"
 +
      end
 +
      # update Pods-NielsenVideoPlayerTVOSPodsXC-frameworks.sh file
 +
      frameworksh_path = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"
 +
      if File.exist?(frameworksh_path)
 +
        puts "post_install: Found #{File.basename(frameworksh_path)}"
 +
        text = File.read(frameworksh_path)
 +
        new_contents = text.gsub('NielsenAppApi.framework', 'NielsenTVAppApi.framework')
 +
        File.open(frameworksh_path, "w") {|file| file.puts new_contents}
 +
        puts "post_install: Updated #{File.basename(frameworksh_path)} file with a value: NielsenTVAppApi.framework"
 +
      end
 +
    end
 +
  end
 +
end
 +
</syntaxhighlight>
 +
<blockquote>If you migrate from the TVOS dynamic framework to the XCFramework, please note that TVOS slices are now part of the same XCFramework with iOS slices. So in addition to appending of the -XC suffix to the pod name in the podfile please remove TVOS. E.g. the naming for the pod NielsenTVOSAppSDK should be changed to NielsenAppSDK-XC.</blockquote>
 +
 
=== Dynamic Framework (Cocoapods 1.6.1+) ===
 
=== Dynamic Framework (Cocoapods 1.6.1+) ===
If using '''Dynamic Framework''' (preferred approach), from the command line, type the following:
+
<blockquote>'''Note''': We highly recommend to migrate to XCFramework for all our clients.</blockquote>
 +
If using '''Dynamic Framework''', from the command line, type the following:
 
<syntaxhighlight lang=Javascript>
 
<syntaxhighlight lang=Javascript>
 
pod repo add NielsenAppSDK https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs-dynamic.git
 
pod repo add NielsenAppSDK https://github.com/NielsenDigitalSDK/nielsenappsdk-ios-specs-dynamic.git
Line 69: Line 109:
 
     #Pods for ApplicationTarget
 
     #Pods for ApplicationTarget
 
     pod 'NielsenAppSDK'
 
     pod 'NielsenAppSDK'
 +
end
 +
</syntaxhighlight>
 +
<blockquote>'''Note''': If you are building an application on a Mac with Apple M1 chip, please add the following fix to end of the podfile</blockquote>
 +
 +
<syntaxhighlight lang=Javascript>
 +
post_install do |installer|
 +
  installer.pods_project.build_configurations.each do |config|
 +
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
 +
  end
 
end
 
end
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 90: Line 139:
 
     #Pods for ApplicationTarget
 
     #Pods for ApplicationTarget
 
     pod 'NielsenAppSDK'
 
     pod 'NielsenAppSDK'
 +
end
 +
</syntaxhighlight>
 +
<blockquote>'''Note''': If you are building an application on a Mac with Apple M1 chip, please add the following fix to end of the podfile</blockquote>
 +
 +
<syntaxhighlight lang=Javascript>
 +
post_install do |installer|
 +
  installer.pods_project.build_configurations.each do |config|
 +
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
 +
  end
 
end
 
end
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
''NOTE: You can have multiple pods within the Podfile''
 
''NOTE: You can have multiple pods within the Podfile''
 +
<br>
 +
<br>
 +
To select a specific version of the Nielsen SDK, just append the build number.  For example, this line is requesting XCFramework build 8.1.0.0:
 +
<syntaxhighlight lang=javascript>
 +
pod 'NielsenAppSDK-XC','8.1.0.0'
 +
</syntaxhighlight>
 +
<br>
 +
If using version control, a warning message will be displayed within the console trace during the build of your app,
 +
and it will show all sdk versions released to-date, allowing a developer to select a more recent build if desired.
 +
<!--
 +
=== For Cocoapods Versions < 1.6.0 ===
 +
 +
If you are using a version of Cocoapods that is less than 1.6.0, you have a Swift Project and your pod has '''use_frameworks!''' please use the following:
 +
 +
<syntaxhighlight lang=javascript>
 +
# Uncomment the next line to define a global platform for your project
 +
platform :ios, '8.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>
 +
-->
  
 
== Execute Install ==
 
== Execute Install ==
Line 104: Line 204:
  
 
Open the file with the extension of <code>.xcworkspace</code> file using Xcode.
 
Open the file with the extension of <code>.xcworkspace</code> file using Xcode.
 +
<!--
 +
== Build Notes ==
 +
Please note that the Nielsen dynamic framework contains slices for devices and simulators.  When building your project it is recommended that Simulator slices are removed before sending the app to the AppStore.  An example of the shell script that should be added as a Run Script phase in the application is attached
 +
<syntaxhighlight lang=Swift>
 +
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
 +
 +
# This script loops through the frameworks embedded in the application and
 +
# removes unused architectures.
 +
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
 +
do
 +
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
 +
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
 +
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
 +
 +
EXTRACTED_ARCHS=()
 +
 +
for ARCH in $ARCHS
 +
do
 +
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
 +
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
 +
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
 +
done
 +
 +
echo "Merging extracted architectures: ${ARCHS}"
 +
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
 +
rm "${EXTRACTED_ARCHS[@]}"
 +
 +
echo "Replacing original executable with thinned version"
 +
rm "$FRAMEWORK_EXECUTABLE_PATH"
 +
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
 +
 +
done
 +
</syntaxhighlight>
 +
-->
  
 
== Pod Versions ==
 
== Pod Versions ==
The following Pod versions are now available:
+
The following Pod versions are now available: (For 'kids' apps, please use the NoId framework (EG: NielsenNoIdAppSDK-XC).
* NielsenAppSDK
+
 
* NielsenTVOSAppSDK  
+
<blockquote>'''Note''': Nielsen SDK builds for tvOS are no longer distributed as separated packages. XCFramework allows to combine iOS and tvOS platforms in a single package. Please use the corresponding XCFramework while migrating from static or dynamic framework for tvOS. E.g. NielsenTVOSAppSDK -> NielsenAppSDK-XC.</blockquote>
* VRIAppSDK
+
 
 +
{| class="wikitable" style="width: 30%;"
 +
|- style="background-color:#efefef;"
 +
! App Flavor Name
 +
|-
 +
| NielsenAppSDK-XC
 +
|-
 +
| NielsenNoAdAppSDK-XC
 +
|-
 +
| NielsenNoIdAppSDK-XC
 +
|}
 +
 
 +
We highly recommend to migrate to XCFramework for all our clients. For clients who still have reasons to keep using the old framework packages in the application and do not migrate to XCFramework we distribute "fat" frameworks both static and dynamic for the release 8.1.0.0. Anyway, our plan to stop distributing "fat" frameworks for future releases and to distribute the Nielsen iOS SDK as an XCFramework only.
 +
 
 +
The following Pod versions are available: (For 'kids' apps, please use the NoId framework (EG: NielsenNoIdAppSDK, NielsenNoIdTVOSAppSDK)
 +
 
 +
{| class="wikitable" style="width: 30%;"
 +
|- style="background-color:#efefef;"
 +
! App Flavor Name
 +
|-
 +
| NielsenAppSDK
 +
|-
 +
| NielsenNoAdAppSDK
 +
|-
 +
| NielsenNoAdTVOSAppSDK
 +
|-
 +
| NielsenNoIdAppSDK
 +
|-
 +
| NielsenNoIdTVOSAppSDK
 +
|-
 +
| NielsenTVOSAppSDK
 +
|}
  
 
=== Regional Builds ===
 
=== Regional Builds ===
* NielsenAGFAppSDK
+
(For 'kids' apps, please use the NoId framework (EG: NielsenAGFNoIdAppSDK-XC, NielsenAGFNoIdTVOSAppSDK-XC)
*  NielsenAGFTVOSAppSDK
+
{| class="wikitable" style="width: 30%;"
* NielsenAGFNoAdAppSDK
+
|- style="background-color:#efefef;"
*  NielsenAGFNoAdTVOSAppSDK
+
! App Flavor Name
 +
|-
 +
| NielsenAGFAppSDK-XC
 +
|-
 +
| NielsenAGFNoAdAppSDK-XC
 +
|-
 +
| NielsenAGFNoIdAppSDK-XC
 +
|}
  
 +
Fat frameworks are still available for the release 8.1.0.0.
 +
 +
{| class="wikitable" style="width: 30%;"
 +
|- style="background-color:#efefef;"
 +
! App Flavor Name
 +
|-
 +
| NielsenAGFAppSDK
 +
|-
 +
| NielsenAGFNoAdAppSDK
 +
|-
 +
| NielsenAGFNoAdTVOSAppSDK
 +
|-
 +
| NielsenAGFNoIdAppSDK
 +
|-
 +
| NielsenAGFNoIdTVOSAppSDK
 +
|-
 +
| NielsenAGFTVOSAppSDK
 +
|}
 +
 +
=== Appsdk Suffix Reference ===
 +
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>
  
 
=== Additional Resources ===
 
=== 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.
 
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>
= How to install the Nielsen App SDK using latest downloaded version of SDK =
+
<br>
# 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.
 

Revision as of 20:14, 21 September 2021

How to install Nielsen 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 XCFramework which requires Cocoapods Version 1.10.1 or higher.
  • 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.

AlertIcon.png

Starting on Sept 21, 2021 the Nielsen SDK has moved to a public repository. Credentials are no longer required.


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

XCFramework (Cocoapods 1.10.1+)

If using XCFramework (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-XC'
end

Note: If you migrate from the iOS dynamic framework to the XCFramework, just add -XC suffix for the pod in the podfile. E.g. NielsenAppSDK should be replaced with NielsenAppSDK-XC. The same Github repo is used for both dynamic and XCFramework.

Note: Nielsen AppSDK clients with applications on TVOS platform should take into account that TVOS slices are now part of the same XCFramework with iOS slices, so the XCFramework name is the same for both iOS and TVOS. But the TVOS framework imported in the application still has TVOS in its name. This is needed to reduce the number of changes in the existing apps. The code below should be added into the podfiles for TVOS XCFramework users.

# modify XCFramework configuration files to update NielsenAppApi.framework -> NielsenTVAppApi.framework
post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'Pods-NielsenVideoPlayerTVOSPodsXC'
      # update Pods-NielsenVideoPlayerTVOSPodsXC.debug.xcconfig file
      # update Pods-NielsenVideoPlayerTVOSPodsXC.release.xcconfig file
      target.build_configurations.each do |config|
          xcconfig_path = config.base_configuration_reference.real_path
          puts "post_install: Found #{File.basename(xcconfig_path)}"
          xcconfig = File.read(xcconfig_path)
          new_xcconfig = xcconfig.sub('-framework "NielsenAppApi"', '-framework "NielsenTVAppApi"')
          File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
          puts "post_install: Updated #{File.basename(xcconfig_path)} file with a value: NielsenTVAppApi.framework"
      end
      # update Pods-NielsenVideoPlayerTVOSPodsXC-frameworks.sh file
      frameworksh_path = "Pods/Target Support Files/#{target.name}/#{target.name}-frameworks.sh"
      if File.exist?(frameworksh_path)
        puts "post_install: Found #{File.basename(frameworksh_path)}"
        text = File.read(frameworksh_path)
        new_contents = text.gsub('NielsenAppApi.framework', 'NielsenTVAppApi.framework')
        File.open(frameworksh_path, "w") {|file| file.puts new_contents}
        puts "post_install: Updated #{File.basename(frameworksh_path)} file with a value: NielsenTVAppApi.framework"
      end
    end
  end
end

If you migrate from the TVOS dynamic framework to the XCFramework, please note that TVOS slices are now part of the same XCFramework with iOS slices. So in addition to appending of the -XC suffix to the pod name in the podfile please remove TVOS. E.g. the naming for the pod NielsenTVOSAppSDK should be changed to NielsenAppSDK-XC.

Dynamic Framework (Cocoapods 1.6.1+)

Note: We highly recommend to migrate to XCFramework for all our clients.

If using Dynamic Framework, 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

Note: If you are building an application on a Mac with Apple M1 chip, please add the following fix to end of the podfile

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
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: If you are building an application on a Mac with Apple M1 chip, please add the following fix to end of the podfile

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
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 XCFramework build 8.1.0.0:

pod 'NielsenAppSDK-XC','8.1.0.0'


If using version control, a warning message will be displayed within the console trace during the build of your app, and it will show all sdk versions released to-date, allowing a developer to select a more recent build if desired.

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: (For 'kids' apps, please use the NoId framework (EG: NielsenNoIdAppSDK-XC).

Note: Nielsen SDK builds for tvOS are no longer distributed as separated packages. XCFramework allows to combine iOS and tvOS platforms in a single package. Please use the corresponding XCFramework while migrating from static or dynamic framework for tvOS. E.g. NielsenTVOSAppSDK -> NielsenAppSDK-XC.

App Flavor Name
NielsenAppSDK-XC
NielsenNoAdAppSDK-XC
NielsenNoIdAppSDK-XC

We highly recommend to migrate to XCFramework for all our clients. For clients who still have reasons to keep using the old framework packages in the application and do not migrate to XCFramework we distribute "fat" frameworks both static and dynamic for the release 8.1.0.0. Anyway, our plan to stop distributing "fat" frameworks for future releases and to distribute the Nielsen iOS SDK as an XCFramework only.

The following Pod versions are available: (For 'kids' apps, please use the NoId framework (EG: NielsenNoIdAppSDK, NielsenNoIdTVOSAppSDK)

App Flavor Name
NielsenAppSDK
NielsenNoAdAppSDK
NielsenNoAdTVOSAppSDK
NielsenNoIdAppSDK
NielsenNoIdTVOSAppSDK
NielsenTVOSAppSDK

Regional Builds

(For 'kids' apps, please use the NoId framework (EG: NielsenAGFNoIdAppSDK-XC, NielsenAGFNoIdTVOSAppSDK-XC)

App Flavor Name
NielsenAGFAppSDK-XC
NielsenAGFNoAdAppSDK-XC
NielsenAGFNoIdAppSDK-XC

Fat frameworks are still available for the release 8.1.0.0.

App Flavor Name
NielsenAGFAppSDK
NielsenAGFNoAdAppSDK
NielsenAGFNoAdTVOSAppSDK
NielsenAGFNoIdAppSDK
NielsenAGFNoIdTVOSAppSDK
NielsenAGFTVOSAppSDK

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.