Difference between revisions of "FBInstant.player.getDataAsync"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(3 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/Player|Player]]<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/Player|Player]]<br/>
Line 6: Line 7:
 
Retrieve data from the designated cloud storage of the current player.<br />
 
Retrieve data from the designated cloud storage of the current player.<br />
 
<br /></translate>
 
<br /></translate>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
  FBInstant.player.getDataAsync(keys,callback)
 
  FBInstant.player.getDataAsync(keys,callback)
</source>
+
</syntaxhighlight>
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
 
'''keys''': (table) <translate>An array of unique keys to retrieve data for.</translate> <br/>
 
'''keys''': (table) <translate>An array of unique keys to retrieve data for.</translate> <br/>
Line 14: Line 15:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''Example'''<br/>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error)
 
FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error)
 
     if result then
 
     if result then
Line 22: Line 23:
 
end
 
end
 
end)
 
end)
<br/></source>
+
<br/></syntaxhighlight>
 +
 
 +
{{FBInstant.player}}

Latest revision as of 15:29, 13 July 2023


Available since: Gideros 2018.3
Class: Player

Description


Retrieve data from the designated cloud storage of the current player.

 FBInstant.player.getDataAsync(keys,callback)

Parameters

keys: (table) An array of unique keys to retrieve data for.
callback: (function) A function that will be called with two arguments: a set of key-value pairs or nil is the operation failed, and an error code if the function failed.

Examples

Example

FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error)
    if result then
		for key,value in pairs(result) do
			print(key,value)
		end
	end
end)
<br/>