// Create the Google API Client with access to Plus and Games
mGoogleApiClient = new GoogleApiClient.Builder(GameCentreActivity.this)
.addConnectionCallbacks(this)
.setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL)
.addOnConnectionFailedListener(this)
.addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN)
.addApi(Games.API).addScope(Games.SCOPE_GAMES)
.build();
findViewById(R.id.sign_in_button).setOnClickListener(this);
findViewById(R.id.sign_out_button).setOnClickListener(this);
findViewById(R.id.show_achievements).setOnClickListener(this);
Я успешно интегрировал игровые сервисы Google Play и могу успешно войти в систему.
После входа в систему я хочу показать пользователю достижения с помощью кнопки. Я реализовал в своем коде следующую реализацию:
[code]// Create the Google API Client with access to Plus and Games mGoogleApiClient = new GoogleApiClient.Builder(GameCentreActivity.this) .addConnectionCallbacks(this) .setGravityForPopups(Gravity.TOP | Gravity.CENTER_HORIZONTAL) .addOnConnectionFailedListener(this) .addApi(Plus.API).addScope(Plus.SCOPE_PLUS_LOGIN) .addApi(Games.API).addScope(Games.SCOPE_GAMES) .build();