1

I used to get the player Rank from google play games leaderboard using the below method. Now the google play services libraries got updated. I am not sure how to get the Rank of the current player. Please assist.

private void accessGooglePlayRank() { 

    Log.i("AndroidLauncher", "Rank : accessGooglePlayRank");
    Games.Leaderboards.loadCurrentPlayerLeaderboardScore(gameHelper.getApiClient(),
            leaderBoardID,
            LeaderboardVariant.TIME_SPAN_ALL_TIME,
            LeaderboardVariant.COLLECTION_PUBLIC).setResultCallback(new ResultCallback<Leaderboards.LoadPlayerScoreResult>() {
        @Override
        public void onResult(Leaderboards.LoadPlayerScoreResult loadPlayerScoreResult) {
            if (loadPlayerScoreResult != null && loadPlayerScoreResult.getScore() != null) {
                globalRank = loadPlayerScoreResult.getScore().getDisplayRank();
                gotRank=true;
            }
        }

    }); 



}
iappmaker
  • 2,945
  • 9
  • 35
  • 76

0 Answers0