Reputation: 73395
The Google documentation at https://developers.google.com/games/services/android/init says that
Your game must have a reference to the GoogleApiClient object in order to make any API calls to the Play Games services. During its activity's lifecycle, your game can retrieve the GoogleApiClient object at any time after onCreate(), by calling getApiClient(). For example:
Games.Leaderboards.submitScore(getApiClient(), LB_ID, 12345);
Initially the page also says:
The BaseGameActivity class wraps the GoogleApiClient, reducing the complexity of setting up a connection with the Google Play servers and managing user sign-in.
However, I can't find getApiClient()
in BaseGameActivity
or in GameHelper
. Where is it?
Upvotes: 1
Views: 3166
Reputation: 73395
Today they updated BaseGameActivity to use the new GoogleApiClient. Apparently they updated the docs days before the code.
Upvotes: 0
Reputation: 4166
The BaseGameActivity
is a wrapper class around GamesClient
, which is deprecated as of February 7th, 2014.
You may use eitherBaseGameActivity
with GamesClient
or GoogleApiClient
.
I think the documentation isn't finished yet. It's from yesterday.
To use the GoogleApiClient
please see
https://developers.google.com/games/services/training/signin#signing_the_player_in_at_startup
Upvotes: 4
Reputation: 1835
I can't look at my own code until I get home, but perhaps my memory will be good enough :-). I don't believe I use getApiClient() anywhere. Perhaps BaseGameActivity is doing that part for you. You may need getGamesClient() instead. Again, going from memory, so this might be useless prattle :-).
Upvotes: 0