Difference between revisions of "FBInstant.setSessionData"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 8: Line 8:
  
 
This function should be called whenever the game would like to update the current session data. This session data may be used to populate a variety of payloads, such as game play webhooks.<br /></translate>
 
This function should be called whenever the game would like to update the current session data. This session data may be used to populate a variety of payloads, such as game play webhooks.<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.setSessionData(sessionData)
 
  FBInstant.setSessionData(sessionData)
 
</source>
 
</source>
Line 15: Line 15:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
FBInstant.setSessionData({coinsEarned=10,eventsSeen={"start","middle"}})
 
FBInstant.setSessionData({coinsEarned=10,eventsSeen={"start","middle"}})
 
<br/></source>
 
<br/></source>
  
 
{{FBInstant}}
 
{{FBInstant}}

Revision as of 15:28, 13 July 2023


Available since: Gideros 2018.3
Class: * Initialisation and Core

Description


Sets the data associated with the individual gameplay session for the current context.

This function should be called whenever the game would like to update the current session data. This session data may be used to populate a variety of payloads, such as game play webhooks.
<syntaxhighlight lang="lua">

FBInstant.setSessionData(sessionData)

</source>

Parameters

sessionData: (table) An arbitrary data table, which must be less than or equal to 1000 characters when stringified.

Examples

Example
<syntaxhighlight lang="lua"> FBInstant.setSessionData({coinsEarned=10,eventsSeen={"start","middle"}})
</source>