Hi
when I am trying to add facebook leaderboard to my project, I got leaderboard data as an array
for example,
[{“rank”:1,“score”:154,“formatted_score”:“154”,“timestamp”:1553511092,“extra_data”:“{"NewScore":154,"KapothiWinCount":1,"currentPoints":150,"WinningCardCount":3}”}];
how I convert this to Lua object array or table.when I trying it display this error
The documentation says that the returned entries are “JSON encoded table of entries”. You need to do:
fbinstant.get_leaderboard_entries(name, count, offset, function(self, entries)
local entries_t = json.decode(entries)
for i,entry in ipairs(entries_t) do
print(entry.score, entry.player_name)
end
end)