Show / Hide Table of Contents

Class AnalyticsHandler

Handles Analytics related API requests. When wishing to start a session or add content, refer to this handler. This handler will also manage analytics submission based on the application life cycle.

Inheritance
System.Object
BaseHandler
AnalyticsHandler
Inherited Members
BaseHandler.GetReusableApiRequest<T>()
BaseHandler.GetHandlerStoragePath<T>()
BaseHandler.JSON_FOLDER_NAME
BaseHandler.GetHandlerJsonFolderPath<K>()
BaseHandler.GetApiJsonFullPath<T, K>()
BaseHandler.GetApiJsonFullPath<T, K>(UserProfile)
BaseHandler.GetApiJsonFullPath<T, K>(T, UserProfile)
BaseHandler.GetApiJsonFullPath<T, K>(UserProfile, Int32, String)
BaseHandler.GetApiJsonFullPath<T, K>(T, UserProfile, Int32, String)
BaseHandler.GetApiDownloadedBytesFullPath<T, K>(T, UserProfile, Int32, String)
BaseHandler.GetContentFromFileProcess(String, Action<Byte[]>, DataTransferStatus)
BaseHandler.SaveContentToFileProcess(Byte[], String, Action<Boolean>)
BaseHandler.DeleteFileProcess(String, Action<Boolean>)
BaseHandler.CopyFileToDestinationProcess(String, String, Action<Boolean>)
BaseHandler.IsThereExistingMediaWithMatchingChecksum(String, String)
BaseHandler.GetChecksumFromExistingFile(String)
BaseHandler.ClearHandlerCache<T>(Action<Boolean>)
BaseHandler.TokenUsedForDownloads
BaseHandler.DownloadGenericFile(String, String, String, Boolean, Action<Byte[]>, DataTransferStatus)
BaseHandler.GetEmsContentFileSize(String, Action<Nullable<Int64>>)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Appearition.Analytics
Assembly: Appearition.SDK.dll
Syntax
public sealed class AnalyticsHandler : BaseHandler

Properties

View Source

OngoingSession

Contains the current ongoing session, if any. In order to start a new session, call BeginSession. This variable will automatically be populated from the outcome. The session will be stored locally, and will by synced with the EMS when available. If a user logs out, you should end the session to sync the content back to the EMS. If the application closes, the content will automatically be synced next time the application is turned on using existing content.

Declaration
public static Session OngoingSession { get; }
Property Value
Type Description
Session

Methods

View Source

AddActivityToCurrentSession(Activity)

Add a given activity to the current session. Ensures that it is properly set up and part of the session, but does not sync it with the EMS. Once the activity is considered complete, submit it using SubmitActivityToCurrentSession.

Declaration
public static Session AddActivityToCurrentSession(Activity activity)
Parameters
Type Name Description
Activity activity
Returns
Type Description
Session
View Source

BeginSession()

Begin a new Analytics Session. If any session was ongoing, it will be handled and closed.

Declaration
public static Session BeginSession()
Returns
Type Description
Session
View Source

BeginSession(String, Int32)

Begin a new Analytics Session. If any session was ongoing, it will be handled and closed.

Declaration
public static Session BeginSession(string tenantKey, int channelId)
Parameters
Type Name Description
System.String tenantKey

The target tenant to record this session against.

System.Int32 channelId

The target channel to record this session against.

Returns
Type Description
Session
View Source

EndCurrentSession()

Finalizes an Analytics Session. While this process is optional, it ensures that the content on the EMS matches the local content, and that the end time of the session is recorded properly.

Declaration
public static void EndCurrentSession()
View Source

GetPathToSessionFile(String)

Generates the path to a Session storage file using a session key.

Declaration
public static string GetPathToSessionFile(string sessionKey)
Parameters
Type Name Description
System.String sessionKey
Returns
Type Description
System.String
View Source

InitializeAnalytics()

Initializes the main analytics module. Ensures that any sessions leftovers are synced properly. By default, begins a new session. ///

Declaration
public static void InitializeAnalytics()
View Source

InitializeAnalytics(Boolean, Action<Session>)

Initializes the main analytics module. Ensures that any sessions leftovers are synced properly. Optionally, starts a new session as well.

Declaration
public static void InitializeAnalytics(bool shouldStartSession, Action<Session> onSessionStarted = null)
Parameters
Type Name Description
System.Boolean shouldStartSession
System.Action<Session> onSessionStarted
View Source

InitializeAnalytics(String, Int32, Action<Session>)

Initializes the main analytics module. Ensures that any sessions leftovers are synced properly. Optionally, starts a new session as well. ///

Declaration
public static void InitializeAnalytics(string tenantKey, int channelId, Action<Session> onSessionStarted = null)
Parameters
Type Name Description
System.String tenantKey
System.Int32 channelId
System.Action<Session> onSessionStarted
View Source

SubmitActivityToCurrentSession(Activity)

Finalizes an activity as part of the current session, and syncs it with the EMS.

Declaration
public static Session SubmitActivityToCurrentSession(Activity activity)
Parameters
Type Name Description
Activity activity
Returns
Type Description
Session
View Source

SyncPendingAnalytics()

Syncs the current local data with the EMS. If a sync process is currently ongoing, waits for it to be complete before starting it.

Declaration
public static void SyncPendingAnalytics()
View Source

SyncPendingAnalyticsProcessWhenAvailable()

Syncs the current local data with the EMS. If a sync process is currently ongoing, waits for it to be complete before starting it.

Declaration
public static IEnumerator SyncPendingAnalyticsProcessWhenAvailable()
Returns
Type Description
System.Collections.IEnumerator
View Source

UpdateOngoingSessionLocalSave()

Updates the local content of this current session using the content of the OnGoing session. This steps ensures that the content is not lost.

Declaration
public static void UpdateOngoingSessionLocalSave()

Extension Methods

ObjectExtension.ToStream(Object)
  • View Source
Back to top Generated by DocFX