# Nielsen DCR
# Features
- Send analytics to Nielsen DCR (Digital Content Ratings) (opens new window)
# Plugin requirements
- iOS 14 or higher
- Xcode
- Swift 5.5
- ByteArkPlayerSDK version >= 0.2.1
# Plugin installation
# CocoaPods (Recommended)
gem install cocoapods
1
- Add the ByteArk Player SDK iOS CocoaPods repo:
pod repo add byteark-player-sdk-ios-specs https://github.com/byteark/byteark-player-sdk-ios-specs.git
1
- Add the Nielsen pod source to your
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/byteark/byteark-player-sdk-ios-specs.git'
source 'https://github.com/NielsenDigitalSDK/nielsenappapple-sdk-specs'
1
2
3
2
3
- Add the plugin:
pod 'ByteArkPlayerSDKNielsenPlugin', '~> BYTEARK_PLAYER_SDK_NIELSEN_PLUGIN_VERSION'
1
- Run
pod install.
# Swift Package Manager
- In Xcode, go to File > Add Packages.
- Enter
https://github.com/byteark/byteark-player-sdk-ios-nielsen-plugin. - Select the version.
# Usage
import UIKit
import ByteArkPlayerSDK
import ByteArkPlayerSDKNielsenPlugin
class PlayerViewController: ByteArkPlayerViewController {
override func viewDidLoad() {
super.viewDidLoad()
do {
// Create the Nielsen config
let nielsenConfig = try ByteArkPlayerNielsenConfigBuilder(
appId: "<NIELSEN_APP_ID>",
appName: "<APP_NAME>",
sfCode: "<SF_CODE>"
).build()
// Create the Nielsen plugin
let nielsenPlugin = ByteArkPlayerNielsenPlugin(with: nielsenConfig)
// Build a player item with Nielsen metadata
let nielsenMetadata = ByteArkPlayerNielsenMetadataBuilder()
.channelName(value: "CHANNEL_NAME")
.clientId(value: "CLIENT_ID")
.program(value: "PROGRAM_NAME")
.title(value: "EPISODE_TITLE")
.length(value: 596)
.build()
let item = try ByteArkPlayerItemBuilder()
.media(URL(string: "<MEDIA_URL>")!)
.title("Big Buck Bunny")
.nielsenMetadata(nielsenMetadata)
.build()
// Configure the player with the Nielsen plugin
let config = try ByteArkPlayerConfigBuilder()
.item(item)
.autoplay(true)
.addPlugin(plugin: nielsenPlugin, name: ByteArkPlayerNielsenPlugin.PluginName)
.build()
player.configure(with: config)
} catch {
print(error.localizedDescription)
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
For Nielsen metadata field details, see the Nielsen DCR Thailand iOS SDK documentation (opens new window).