OtvAnalyticsAgentWrapper
public class OtvAnalyticsAgentWrapper : NSObject
-
Declaration
Swift
public static let shared: OtvAnalyticsAgentWrapper -
Initialise the OpenTv Analytics Agent and Wrapper
Call this method once, before calling any other. Do not call again unless close is called first
Declaration
Swift
public func initialise(wrapperConfig: Dictionary<String, Any>, agentConfig: Dictionary<String, Any>, errorProtocol: OTVAnalyticsAgentErrorListener?) -> OTVAnalyticsAgentErrors?Parameters
wrapperConfigConfiguration for the wrapper
agentConfigConfiguration for the
OtvAnalyticsAgenterrorProtocolReference for listener to handle errors
Return Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise -
Close the analytics session.
After calling this method, do not call any other unless
initialiseis called againDeclaration
Swift
public func close() -> OTVAnalyticsAgentErrors?Return Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise: -
Provide an updated configuration to the analytics agent
Declaration
Swift
public func updateConfig(wrapperConfig: Dictionary<String, Any>?, agentConfig: Dictionary<String, Any>?) -> OTVAnalyticsAgentErrors?Parameters
wrapperConfigupdated configuration for the wrapper
agentConfigupdated configuration for the
OtvAnalyticsAgentReturn Value
OTVAnalyticsAgentErrors if an error occurs,
nilotherwise -
Provide a reference to a Nagra Connect Player which may be used to automatically submit player events detect some activities, and populate some metadata
Must be called before submitting the
playbackStartactivity Must not be changed or removed once playback has started Player may be removed by passing anilreferenceDeclaration
Swift
public func setConnectPlayer(player: OTVAVPlayer?) -> OTVAnalyticsAgentErrors?Return Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise -
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
deviceIdUnique device id as provided by the platform to the client
accountIdThe account id of the current signed-in account
userIdUnique id to identify a user or user profile
metadataContaining key-value pairs of metadata for the
appStartactivityReturn Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise -
Submit the
playbackStartActivityShould be called after a player has been set for the wrapper
Declaration
Swift
public func playbackStart(metadata: Dictionary<String, Any>, insightUserInfo: Dictionary<String, Any>?, insightContent: Dictionary<String, Any>?) -> OTVAnalyticsAgentErrors?Parameters
metadataContaining key-value pairs of metadata for the
playbackStartactivityinsightUserInfoif insight reporting is required
insightContentif insight reporting is required
Return Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise -
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
Return Value
OTVAnalyticsAgentErrorsif an error occurs,nilotherwise
OtvAnalyticsAgentWrapper Class Reference