Hi guys,
I'm trying to implement leaderboards in my Corona SDK game but there is little to none information on how to really implement all the playfab features in Corona SDK.
I've got my user successfully logged in, but can't find how to make the calls to the server. This is what I've got so far for my leaderboard implementation:
function M.uploadHighScore(highscore) local function networkListener( event ) if ( event.isError ) then print( "Network error: ", event.response ) else print ( "Upload complete!" ) end end local headers = {} headers["Content-Type"] = "application/json" headers["X-API-Key"] = "13b6ac91a2" local params = {} params.headers = headers -- Tell network.request() to get the request body from a file: params.body = { filename = "object.json", baseDirectory = system.DocumentsDirectory } network.request( "https://XXXX.playfabapi.com/Client/UpdatePlayerStatistics", "POST", networkListener, params ) end
(I replaced the XXXX in the link with the correct code)
But I need the user_session_ticket_value for the X-API-KEY part. But how do I get that in Corona? And if I want to upload a single value (highscore = 6), will I have to convert that into a json table?
I'm very new to this so don't throw to many fancy words at me :)
Kind regards
Bram