I am also facing this problem with Javascript SDK

0 votes
I would just like only the additional data that was saved with related saved score
related to an answer for: Leaderboard additional data
asked Nov 8, 2014 in App42 Cloud API-BaaS by Kenny Arneaud (15 points)

1 Answer

0 votes

Hello Kenny,

You can find the additional information of user from the storage service as described in this thread. Apart from this if you need to fetch the data relative to score id  in GetTopNRankers call is already planned for this release & it will be live before 15 of this month. We update you for the same on this thread.

Thanks for your patience. Let us know if you have more question for us.

Himanshu Sharma

answered Nov 10, 2014 by hs00105 (2,005 points)
This is cool however I am using javascript. Am I to assume this can be done for javascript as well as I see no forth coming documentation. Also can it "update on duplicate" or null on duplicate?
Hello Kenny,

Kindly find the below code snippet to fetch the relative JSON document stored in storage service along with leader-board call:

var gameName = "<Enter_your_game_name>",
userName = "Nick",
result ;  
var otherMetaHeaders = { isAttachScoreId : true };
scoreBoardService.setOtherMetaHeaders(otherMetaHeaders);                 
scoreBoardService.getScoresByUser(gameName,userName,{  
            success: function(object)
            {
                        var game = JSON.parse(object);  
                        result = game.app42.response.games.game;
                        console.log("gameName is : " + result.name)
                        var scoreList = result.scores.score;
                        console.log("userName is : " + scoreList.userName)
                        console.log("scoreId is : " + scoreList.scoreId)
                        console.log("value is : " + scoreList.value)
            },  
            error: function(error) {  
            }  
});
 
Let us know if it helps.
Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...