From cadf8d5a709629432afc8cfe7af32760cde2d353 Mon Sep 17 00:00:00 2001 From: Jason Salaber Date: Sun, 17 Feb 2019 19:27:56 -0500 Subject: [PATCH] Roku 1.1.0 Release (#2) Roku 1.1.0 Release --- .../framework/taplytics/TaplyticsAPI.brs | 3 +- .../taplytics/TaplyticsPrivateAPI.brs | 30 +++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/source/components/framework/taplytics/TaplyticsAPI.brs b/source/components/framework/taplytics/TaplyticsAPI.brs index fdcc68d..b32181d 100644 --- a/source/components/framework/taplytics/TaplyticsAPI.brs +++ b/source/components/framework/taplytics/TaplyticsAPI.brs @@ -37,9 +37,8 @@ function getValueForVariable(params as Object) as Object if m.top.enablePrint then print "Variable name --> ",params.name if m.top.enablePrint then print "Default value --> ",params.default - value = "NOTREADY" + value = params.default if m._clientConfigReady - value = params.default if m._clientConfig.DoesExist(params.name) then value = m._clientConfig[params.name] end if return value diff --git a/source/components/framework/taplytics/TaplyticsPrivateAPI.brs b/source/components/framework/taplytics/TaplyticsPrivateAPI.brs index 74b72a2..badff5f 100644 --- a/source/components/framework/taplytics/TaplyticsPrivateAPI.brs +++ b/source/components/framework/taplytics/TaplyticsPrivateAPI.brs @@ -1,5 +1,5 @@ function init() - m.TAP_SDK_VERSION = "1.0.1" + m.TAP_SDK_VERSION = "1.1.0" m.top.id = "tap" m.messagePort = _createPort() @@ -126,7 +126,7 @@ end function function Taplytics() as Object prototype = {} - prototype.TAP_SDK_VERSION = "1.0.1" + prototype.TAP_SDK_VERSION = "1.1.0" prototype.PLAYER_SOFTWARE_NAME = "RokuSG" prototype.TAP_API_VERSION = "2.0" prototype.PLAYER_IS_FULLSCREEN = "true" @@ -194,7 +194,7 @@ function Taplytics() as Object prototype.logEvent = function(data as Object) if m._top.enablePrint then print "ENTER logEvent>>>" - m._postClientEvents(data) + m._postClientEvents("goalAchieved", data) end function prototype.resetAppUser = function() @@ -384,18 +384,18 @@ function Taplytics() as Object end function - prototype._postClientEvents = function(queryParameters as Object) + prototype._postClientEvents = function(eventType as Object, queryParameters as Object) ' t - Taplytics API Key ● API Key ' sid - Session_id ' e - Array of events - ' type - type of the event (String) - ' gn - goal name (String) - ' date - current date (Date) - ' val - numerical value (Double) - ' data - metaData (JSON Object) - ' prod - is prod, not live update (Boolean) - ' sid - session_id (String) + ' type - type of the event (String) + ' gn - goal name (String) + ' date - current date (Date) + ' val - numerical value (Double) + ' data - metaData (JSON Object) + ' prod - is prod, not live update (Boolean) + ' sid - session_id (String) requiredParamaters = {} @@ -407,7 +407,10 @@ function Taplytics() as Object 'create event event = {} - event.type = "goalAchieved" + + event.type = eventType + print "event type: ", event.type + if queryParameters.DoesExist("eventName") and queryParameters.eventName <> "" event.gn = queryParameters.eventName end if @@ -488,6 +491,9 @@ function Taplytics() as Object m._top.clientConfig = m._variables if m._top.enablePrint then print m._variables m._clientConfigReady = true + + m._postClientEvents("appActive", {}) + end if end function