I'm working on a multi level Android game and I want to pull the highscores after sign in. I'm doing this:
Games.Leaderboards.loadCurrentPlayerLeaderboardScore(getApiClient(), getString(LEADER_BOARDS[i]),
LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC)
.setResultCallback(this);
But the callback doesn't give me the leaderboard id:
@Override
public void onResult(LoadPlayerScoreResult res) {
}
I only get the score (res.getScore()
).
So do I have to create callbacks for each of my 25 levels or is there a better solution?
This doesn't work as well:
for (int i = 0; i < 25; i++)
Games.Leaderboards.loadCurrentPlayerLeaderboardScore(getApiClient(), getString(LEADER_BOARDS[i]),
LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC)
.setResultCallback(new ResultCallback<LoadPlayerScoreResult>() {
@Override
public void onResult(LoadPlayerScoreResult res) {
// can't use variable i here
}
});