Skip to content

Commit 3ffab2f

Browse files
authored
Feature:expose session info as scenegraph node (#38)
1 parent 2411fc4 commit 3ffab2f

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

mParticleCore.brs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function mParticleConstants() as object
3434
SCENEGRAPH_NODES = {
3535
API_CALL_NODE: "mParticleApiCall",
3636
CURRENT_USER_NODE: "mParticleCurrentUser",
37-
IDENTITY_RESULT_NODE: "mParticleIdentityResult"
37+
IDENTITY_RESULT_NODE: "mParticleIdentityResult",
38+
CURRENT_SESSION_NODE: "mParticleCurrentSession"
3839
}
3940
USER_ATTRIBUTES = {
4041
FIRSTNAME: "$FirstName",

mParticleTask.brs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ sub setupRunLoop()
1616
mParticleStart(options, m.port)
1717
m.mparticle = mparticle()
1818
m.top[mParticleConstants().SCENEGRAPH_NODES.CURRENT_USER_NODE] = m.mparticle.identity.getCurrentUser()
19+
m.top[mParticleConstants().SCENEGRAPH_NODES.CURRENT_SESSION_NODE] = m.mparticle._internal.sessionManager.getCurrentSession()
1920
while true
2021
msg = wait(15 * 1000, m.port)
2122
if (msg = invalid) then

mParticleTask.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<field id="mParticleApiCall" type="assocarray"/>
55
<field id="mParticleIdentityResult" type="assocarray"/>
66
<field id="mParticleCurrentUser" type="assocarray"/>
7+
<field id="mParticleCurrentSession" type="assocarray"/>
78
</interface>
89
<!-- Replace with correct path if necessary -->
910
<script type="text/brightscript" uri="pkg:/components/mParticleTask.brs"/>

0 commit comments

Comments
 (0)