OtvAnalyticsAgent
public class OtvAnalyticsAgent
-
Declaration
Swift
public static let shared: OtvAnalyticsAgent -
Initialise the OpenTv Analytics Agent
Call this method once, before calling any other methods. Do not call again unless close is called first.
Config dictionary received in this API will look something like this:
let config = [ "destinations": [ [ "name": "uav", "config": [ "url": "<uav url>", "token": "<uav token>" ], ], [ "name": "dwh", "config": [ "url": "<uav url>", "token": "<uav token>" ], ] ], ]Declaration
Swift
public func initialise(config: Dictionary<String, Any>, otvaAErrorProtocol: OTVAnalyticsAgentErrorListener?) -> OTVAnalyticsAgentErrors?Parameters
configOTVAnalyticsAgentConfigotvaAErrorProtocolreference to the error protocol used to log errors
-
Close the analytics session.
After calling this method, do not call any other unless
initialiseis called againDeclaration
Swift
public func close() -> OTVAnalyticsAgentErrors? -
Provide an updated configuration to the analytics agent
Declaration
Swift
public func updateConfig(config: Dictionary<String, Any>) -> OTVAnalyticsAgentErrors?Parameters
configOTVAnalyticsAgentConfig -
Submit the
appStartActivityMust be the first activity submitted (must be called before any other calls to
submitActivity)Should not be called again without first submitting an
appStopactivityDeclaration
Swift
public func appStart(metadata: Dictionary<String, Any>) -> OTVAnalyticsAgentErrors?Parameters
metadataContaining key-value pairs of metadata for the
appStartactivity -
- Submit an activity
Declaration
Swift
public func submitActivity(activity: OtvActivity, metadata: Dictionary<String, Any>) -> OTVAnalyticsAgentErrors?Parameters
activityThe
OtvActivitybeing submittedmetadataContaining key-value pairs of metadata for the submitted activity
OtvAnalyticsAgent Class Reference