You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,16 +86,18 @@ public class SetPlayerPrefs : MonoBehaviour
78
86
```
79
87
### Session Variable Documentation
80
88
81
-
|Variable Name | Description |
82
-
| ----------- | ----------- |
83
-
| LRSEnableUserLocation | This enables the external calls required to get user regional information packaged with the statement. This data is set in `$.context.extensions.http://ip-api.com/location`|
84
-
|LRSEmail | User ID in the form of an email. Follows the [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987) specification.|
85
-
|LRSAccountId | A User ID that's contained within a system. (Requires LRSHomepage to be set).|
86
-
|LRSHomepage | A homepage for the LRSAccountId (Requires LRSAccountId to be set).|
87
-
|LRSUsernameDisplay | A human readable username display.|
88
-
|LRSGameId | A Game ID in the form of an IRI. Follows the [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987) specification.|
89
-
|LRSGameDisplay| A human readable display of the game being played.|
90
-
|LRSSessionIdentifier| A UUID that uniquely identifies the session being engaged with. This is something that would get set whenever the user initializes a new session.|
89
+
|Variable Name | Description | Statement Fields Populated |
90
+
| ----------- | ----------- | ----------- |
91
+
|LRSEnableUserLocation | This enables the external calls required to get user regional information packaged with the statement. |`$.context.extensions.http://ip-api.com/location`|
92
+
|LRSEmail | User ID in the form of an email. Follows the [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987) specification.|`$.actor.mbox`|
93
+
|LRSAccountId | A User ID that's contained within a system. (Requires LRSHomepage to be set).|`$.actor.account.name`|
94
+
|LRSHomepage | A homepage for the LRSAccountId (Requires LRSAccountId to be set).|`$.actor.account.homePage`|
95
+
|LRSUsernameDisplay | A human readable username display.|`$.actor.name`|
96
+
|LRSGameId | A Game ID in the form of an IRI. Follows the [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987) specification.|`$.object.id`, `$.context.platform`|
97
+
|LRSGameDisplay| A human readable display of the game being played.|`$.object.definition.name.en-US`|
98
+
|LRSSessionIdentifier| A UUID that uniquely identifies the session being engaged with. This is something that would get set whenever the user initializes a new session.|`$.context.registration`|
99
+
|LRSActivityId| Optional ActivityID in the form of an IRI. Follows the [RFC 3987](https://datatracker.ietf.org/doc/html/rfc3987) specification.|`$.object.id`|
100
+
|LRSActivityDefinition| human readable activity definition display. |`$.object.definition.name.en-US`|
91
101
92
102
### Setting up a Scene
93
103
@@ -133,17 +143,33 @@ public class xApiIntegration : MonoBehaviour
133
143
134
144
// Start is called before the first frame update
135
145
voidStart() {
146
+
// by default, SendStartedStatement can be called with no arguments and uses the configuration from PlayerPrefs to populate it's statements
147
+
// Note that you can set LRSActivityId and LRSActivityDefinition to override the default activity (which is LRSGameId).
136
148
publisher.SendStartedStatement();
149
+
150
+
// you can overload SendStartedStatement with a custom ActivityID if you wish to dynamically modify the activity.
151
+
// this overrides $.object.id and $.object.definition.name.en-US):
152
+
publisher.SendStartedStatement("http://video.games/clicker/level/1", "Level 1 of clicking game");
137
153
}
138
154
139
155
// Example of something we can call externally via some object callback (Like a GUI button)
140
156
publicvoidOnButtonPress() {
157
+
// similarly, with SendCompletedStatement...
141
158
publisher.SendCompletedStatement();
159
+
160
+
// or with overrides...
161
+
publisher.SendCompletedStatement("http://video.games/clicker/level/1", "Level 1 of clicking game");
142
162
}
143
163
144
-
// Example of sending a statement only configuring the verb.
145
164
voidOnApplicationQuit() {
165
+
// Example of sending a statement only configuring the verb.
0 commit comments