FBInstant.player.getDataAsync

From GiderosMobile
Revision as of 15:28, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")


Available since: Gideros 2018.3
Class: Player

Description


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

<syntaxhighlight lang="lua">

FBInstant.player.getDataAsync(keys,callback)

</source>

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
<syntaxhighlight lang="lua"> FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error)

   if result then

for key,value in pairs(result) do print(key,value) end end end)
</source>