Skip to content

Commit

Permalink
Feature:expose session info as scenegraph node
Browse files Browse the repository at this point in the history
  • Loading branch information
mmustafa-tse committed Nov 15, 2023
1 parent 2411fc4 commit 5d0e692
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mParticleCore.brs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ function mParticleConstants() as object
SCENEGRAPH_NODES = {
API_CALL_NODE: "mParticleApiCall",
CURRENT_USER_NODE: "mParticleCurrentUser",
IDENTITY_RESULT_NODE: "mParticleIdentityResult"
IDENTITY_RESULT_NODE: "mParticleIdentityResult",
CURRENT_SESSION_NODE: "mParticleCurrentSession"
}
USER_ATTRIBUTES = {
FIRSTNAME: "$FirstName",
Expand Down
1 change: 1 addition & 0 deletions mParticleTask.brs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ sub setupRunLoop()
mParticleStart(options, m.port)
m.mparticle = mparticle()
m.top[mParticleConstants().SCENEGRAPH_NODES.CURRENT_USER_NODE] = m.mparticle.identity.getCurrentUser()
m.top[mParticleConstants().SCENEGRAPH_NODES.CURRENT_SESSION_NODE] = m.mparticle._internal.sessionManager.getCurrentSession()
while true
msg = wait(15 * 1000, m.port)
if (msg = invalid) then
Expand Down
1 change: 1 addition & 0 deletions mParticleTask.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<field id="mParticleApiCall" type="assocarray"/>
<field id="mParticleIdentityResult" type="assocarray"/>
<field id="mParticleCurrentUser" type="assocarray"/>
<field id="mParticleCurrentSession" type="assocarray"/>
</interface>
<!-- Replace with correct path if necessary -->
<script type="text/brightscript" uri="pkg:/components/mParticleTask.brs"/>
Expand Down

0 comments on commit 5d0e692

Please sign in to comment.