Difference between revisions of "FBInstant.player.getDataAsync"
From GiderosMobile
Line 2: | Line 2: | ||
'''Available since:''' Gideros 2018.3<br/> | '''Available since:''' Gideros 2018.3<br/> | ||
=== Description === | === Description === | ||
− | <br /> | + | <translate><br /> |
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 /> | + | <br /></translate> |
<source lang="lua"> | <source lang="lua"> | ||
FBInstant.player.getDataAsync(keys,callback) | FBInstant.player.getDataAsync(keys,callback) | ||
</source> | </source> | ||
=== Parameters === | === Parameters === | ||
− | '''keys''': (table) An array of unique keys to retrieve data for. <br/> | + | '''keys''': (table) <translate>An array of unique keys to retrieve data for.</translate> <br/> |
− | '''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. <br/> | + | '''callback''': (function) <translate>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.</translate> <br/> |
=== Examples === | === Examples === | ||
'''Example'''<br/> | '''Example'''<br/> | ||
− | <source lang="lua" | + | <source lang="lua"> |
FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error) | FBInstant.player.getDataAsync({"achievements","currentLife"}, function(result,error) | ||
if result then | if result then |
Revision as of 13:34, 23 August 2018
Available since: Gideros 2018.3
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/>