26

I want to get all connected players to game. I can get players that are in google+ circles but I want the player to get all users. I can't find what permission do I need to do this.

I am using this code to get players, but it always returns 0.

PendingResult<LoadPlayersResult> players = Games.Players.loadConnectedPlayers(mGoogleApiClient, false);

players.setResultCallback(new ResultCallback<Players.LoadPlayersResult>()
{
    @Override
    public void onResult(LoadPlayersResult result) 
    {
        PlayerBuffer buf = result.getPlayers(); 
        Toast.makeText(getApplicationContext(), "players"+buf.getCount(), Toast.LENGTH_SHORT).show();
    }
}); 
always-a-learner
  • 3,671
  • 10
  • 41
  • 81
Dzzeeee
  • 261
  • 2
  • 4
  • Have you done this issue yet? If yes, give us your solution, thanks ! – NamNH Oct 27 '15 at 11:15
  • Have you checked the status code of your result? Maybe this gives a hint on what is going wrong: https://developers.google.com/android/reference/com/google/android/gms/games/Players.LoadPlayersResult – ultimate Oct 27 '15 at 11:40
  • Status code is STATUS_OK always. I think the reason is it's required permission "who can see your game activity"?. Can we add default full permissions when user sign in first time? – NamNH Oct 27 '15 at 12:06

1 Answers1

1

this had been pre-announced and then announced a while ago already and method .loadConnectedPlayers() had been deprecated... which merely boils down to, that Google+ had been separated from Play Games and the functionality you are looking for is not available anymore.

in order to get a list of connected players, you would have to use your own API now. Just seen the question is old and had been posted before the announce - nevertheless this appears to be the current status.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216