iOS Static Framework Setup
From Engineering Client Portal
Configuring Xcode Development Environment for Static Framework
Importing Frameworks
The first step is to ensure that the following frameworks and libraries are imported into the Frameworks folder of the Xcode project before creating an instance of the Nielsen App SDK object.
- UIKit.framework
- Foundation.framework
- AdSupport.framework
- JavascriptCore.framework
- WebKit.framework
- SystemConfiguration.framework
- Security.framework
- Nielsen Analytics framework makes use of a number of functions in this library.
- AVFoundation.framework
- NielsenAppApi.framework
- libc++.tbd (as SDK contains Objective C++ source file)
- Alternatively, include -lstdc++ in Build Settings → Other Linker Flag of the Xcode project
Example
- Extract “NielsenAppApi.Framework” from the Nielsen App SDK sample app and copy it to Frameworks folder of the Xcode project.
- Add the code
-#import NielsenAppApi/NielsenAppApi.h
to the View Controller’s header file.
Ensure that the following are included in the Linked Frameworks and Libraries list (located in the project’s Summary settings).
- Nielsen App SDK
- iOS security framework
Using Swift
To import a set of Objective-C files in the same app target as your Swift code, you rely on an Objective-C bridging header to expose those files to Swift. Xcode offers to create this header file when you add a Swift file to an existing Objective-C app, or an Objective-C file to an existing Swift app.
- Select File/New File/Objective-C File
- Xcode will prompt you to create a bridging header.
Once this file has been created, you need to add the following:
#import <NielsenAppApi/NielsenAppApi.h>
Using Objective-C
Add the code
#import <NielsenAppApi/NielsenAppApi.h>
to the View Controller’s header file.