Difference between revisions of "FBInstant.context.getID"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 
'''<translate>Available since</translate>:''' Gideros 2018.3<br/>
 +
'''<translate>Class</translate>:''' [[Special:MyLanguage/Context|Context]]<br/>
 
=== <translate>Description</translate> ===
 
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
 
A unique identifier for the current game context. This represents a specific context that the game is being played in (for example, a particular messenger conversation or facebook post). The identifier will be null if game is being played in a solo context. The result is not guaranteed to be correct until FBInstant.startGameAsync has resolved.<br />
 
A unique identifier for the current game context. This represents a specific context that the game is being played in (for example, a particular messenger conversation or facebook post). The identifier will be null if game is being played in a solo context. The result is not guaranteed to be correct until FBInstant.startGameAsync has resolved.<br />
 
<br /></translate>
 
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(string) = FBInstant.context.getID()
 
(string) = FBInstant.context.getID()
</source>
+
</syntaxhighlight>
 
=== <translate>Return values</translate> ===
 
=== <translate>Return values</translate> ===
 
'''<translate>Returns</translate>''' (string) <translate>A unique identifier for the current game context.</translate><br/>
 
'''<translate>Returns</translate>''' (string) <translate>A unique identifier for the current game context.</translate><br/>
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
fbContextId=FBInstant.context.getID()
 
fbContextId=FBInstant.context.getID()
 
if fbContextId~="null" then
 
if fbContextId~="null" then
Line 23: Line 25:
 
print("You may have tried to access a context high score in solo mode!")
 
print("You may have tried to access a context high score in solo mode!")
 
end
 
end
<br/></source>
+
<br/></syntaxhighlight>
 +
 
 +
{{FBInstant.context}}

Latest revision as of 14:27, 13 July 2023


Available since: Gideros 2018.3
Class: Context

Description


A unique identifier for the current game context. This represents a specific context that the game is being played in (for example, a particular messenger conversation or facebook post). The identifier will be null if game is being played in a solo context. The result is not guaranteed to be correct until FBInstant.startGameAsync has resolved.

(string) = FBInstant.context.getID()

Return values

Returns (string) A unique identifier for the current game context.

Examples

Example

	fbContextId=FBInstant.context.getID()
	if fbContextId~="null" then
		print("context",fbContextId)
		FBInstant.getLeaderboardAsync("Highest Level Achievers."..fbContextId,function (e,error)
			print("group leaderboard event",e)
			print("group leaderboard error",error)
		end)
	else
		print("You may have tried to access a context high score in solo mode!")
	end
<br/>