Get Top N Rankers By Date does not seem to exist!

0 votes
When calling getTopNRankersByDate I get the following error message: scoreBoardService.getTopNRankersByDate is not a function... Get Top N Rankers (without date specification) works fine however.
asked Dec 18, 2017 in Android by anders (10 points)
edited Dec 18, 2017 by anders

1 Answer

0 votes

Hi Anders,

Apologies for the inconvenience

There is some documentation mistake, please use getTopNRankersBetweenDate() please find below the code snippet to fetch the required data from the leaderboard.

function getTopNRankersBetweenDate(){
 
var max =1;  
var gameName = "STARCRICKET";  
var startDate = null; /* Get date from your source */  
var endDate = null; /* Get date from your source */  
var result ;    
App42.initialize("145152e917af6f19a7d09c40d3b4e359fe8a5c321b1dc0f83a8bd03560cea96e","b53cef7465035288b87a4bfcb5a3ccae6355b0daa536e5dcc60decdd636d8066");  
var scoreBoardService  = new App42ScoreBoard();  
scoreBoardService.getTopNRankersBetweenDate(gameName,startDate,endDate,max,{    
    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;  
        if (scoreList instanceof Array) {  
                for (var i = 0; i < scoreList.length; i++) {  
                    console.log("userName is : " + scoreList[i].userName)  
                    console.log("scoreId is : " + scoreList[i].scoreId)  
                    console.log("value is : " + scoreList[i].value)  
                }  
            } else {  
                console.log("userName is : " + scoreList.userName)  
                console.log("scoreId is : " + scoreList.scoreId)  
                console.log("value is : " + scoreList.value)  
            }  
    },    
    error: function(error) {    
    }    
});   
}

In case if you have any other queries please do feel free to reach out to us.

We will be happy to help you.

 

Regards,

Priyanka Singh

App42 Team

 

answered Dec 18, 2017 by anonymous
Thank you for the prompt reply!
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
...