Insight Agent for Apple
The NagraInsightReferenceApp.zip file includes the Nagra Insight Framework for iOS and TVOS (Device and Simulator) and a universal TVOS and iOS reference Application.
Using the Insight Agent, this application illustrates how to report the Events and Metrics of Video Applications based on AVPlayer / AVPlayerViewController. You can also use the Insight Agent with any other Video Player.
Please check the /doc folder for details on the Classes and Structs provided.
Getting Started
Selecting the Platform to test
Configuring the Agent
Set the operatorId and collectorURL configuration parameters in the ViewController.swift file. You may also configure the samplingInterval or the reportingInterval, amongst other parameters. Check the documentation for additional details.
/// ------------------
/// ViewController.swift
/// ------------------
///
/// Insight Agent Initialisation
///
// Insight Configuration Check the documentation for all possible parameters
#if os(tvOS) 11 let config = InsightConfig(
collectorURL: "https://collector.insight-stats.com/api/v1/",
deviceId: "AppleTVTestDeviceId", operatorId: "yourOperatorToken", samplingInterval: 30, reportingInterval: 300, deviceType: DeviceType.stb, osName:"TVOS")
#elseif os(iOS)
let config = InsightConfig(
collectorURL: "https://collector.insight-stats.com/api/v1/",
deviceId: "iOSTestDeviceId", operatorId: "yourOperatorToken", samplingInterval: 30, reportingInterval: 300, deviceType: DeviceType.handheld, osName:"iOS")
#endif
// User Information. Check documentation for additional parameters.
let userInfo = UserInfo(userId: "refUserId", accountId: "refAccountId")
InsightAgent.shared.initialise(config: config, userInfo: userInfo)
Running the Application
Start the Application, and select Play. The demo video will begin to play.
Viewing the raw report
Log into the product with the URL provided.
Open the Collector Debugger module. The raw Events and Metrics will be shown.