scoreBoardService.getTopNRankersFromFacebookByDateRange not work

0 votes

I'm using ScoreBoardService to fetch score-board for facebook friends by using this function:- "scoreBoardService.getTopNRankersFromFacebookByDateRange" but it return exception :

"Error: {"app42Fault":{"httpErrorCode":404,"appErrorCode":3027,"message":"Not Found","details":"Scores betweem startDate 'Mon Nov 03 00:47:17 UTC 2014' and endDate 'Mon Nov 03 03:20:59 UTC 2014' with friends for the game name 'TrueMode2' does not exist."}}"

 

Steps for getting friends score from Facebook:

1. Login to Facebook.

2. Link user facebook account using socialService.LinkUserFacebookAccount
3. Save score by service scoreBoardService.saveUserScore(gameName,userName,gameScore, new callback()); 
4. Get friends score from Facebook using scoreBoardService.GetTopNRankersFromFacebook.
 

var accessToken:String = "CAAGhX8G6xjcBAP83HdqeVthbqIWbztMkbaHPzNpGX0QkLEZBnYZBAgycP9zfNEjk9TdfiPPfQBbyW5eK7LkcVIZBzwElaWi5MPhS417cOxoziDDZCovF7QJ9ZCSg8nJHYUz6RBxlZAVatfVF6LZBXYXWwE4mAUYd3UsnBiZARTmDhn5GW5xWhZA6SyExXZAwSiMQR5QqiJptpxeZA7Jk1bsJQTqVZBihSBQ4k4IZD";

var max:int= 1000;  

var callback:callbackGetData = new callbackGetData(isFriend);

ColorBlind.instance.scoreBoardService.getTopNRankersFromFacebookByDateRange("TrueMode2", accessToken, new Date(1414975637000), new Date(), max ,callback);

 

asked Nov 3, 2014 in App42 Cloud API-BaaS by Trần Duy Tân (10 points)
edited Nov 3, 2014 by Trần Duy Tân

1 Answer

0 votes

Hello Tran,

Please save user score with Facebook Id of user as username to get the top rankers among Facebook friends. Kindly make these changes and let us know if it helps,

Thanks,

Himanshu Sharma

 

answered Nov 3, 2014 by hs00105 (2,005 points)
Thank Himanshu Sharma.
but i have one more question
if i use scoreBoardService.getTopNRankers(gameName,max, new callback()) ,  i can't get name of user because I use username to contain Facebook Id
Hello Tran,
 
In such case, save the user profile in Storage service  and fetch it back into app using query interface to display in the leaderboard. Please have a look on the below link which will help you in saving additional data into Storage service and displaying App42 leader board.

 
http://blogs.shephertz.com/2014/04/08/saving-additional-data-fetching-back-app42-leaderboard/
 
Let us know if it helps.
 
Thanks
I hope your query has been resolved, kindly let us know if you have more questions for us.
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
...