question

Kostas avatar image
Kostas asked

Does getLeaderboard() actually work for GetScoreResponses?

This page: https://developer.amazon.com/public/binaries/content/assets/javadoc/gamecircle-api/2_4/reference/com/amazon/ags/api/leaderboards/getscoresresponse.html Suggests that GetScoresResponse implements a getLeaderboard() which returns the Leaderboard that the Score belongs to, however I get a compile error when I try to use it Here's the offending code: mGamesClient.getLeaderboardsClient().getScores(ldrb.getId(), LeaderboardFilter.GLOBAL_ALL_TIME).setCallback( new AGResponseCallback () { @Override public void onComplete(GetScoresResponse scores_result) { if (scores_result.isError()) { Log.v(TAG, "getScores ERROR: " + scores_result.getError()); } else { Log.v(TAG, "getScores for leaderboard: " + scores_result.getLeaderboard().getName() + " SUCCESSFUL!"); And this is the error I get: cannot find symbol symbol : method getLeaderboard() location: interface com.amazon.ags.api.leaderboards.GetScoresResponse Log.v(TAG, "getScores for leaderboard: " + scores_result.getLeaderboard().getName() + " SUCCESSFUL!");
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hey Kostas, Yes. It does. Below is the Score interface definition. public abstract interface Score { public abstract Player getPlayer(); public abstract long getScoreValue(); public abstract String getScoreString(); public abstract int getRank(); public abstract String getLeaderboard(); } Please see the logs of my sample app (that I have sent you to your registered email address) in your other post https://forums.developer.amazon.com/forums/thread.jspa?messageID=11486Ⳟ ******************* System.out.println("score.getLeaderboard() = " + score.getLeaderboard()); ******************** 06-24 02:07:18.148 7341-7341/com.example.leaderboardtest I/System.out﹕ score.getLeaderboard() = 14 *********************** Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.