title: Google play how to invite a player to a room
body: <p>I have this code:</p>
  
  <pre><code>RoomConfig.Builder rtmConfigBuilder = makeBasicRoomConfigBuilder();
  rtmConfigBuilder.addPlayersToInvite(opponentId);
  rtmConfigBuilder.setAutoMatchCriteria(null);
  mGamesClient.createRoom(rtmConfigBuilder.build());
  </code></pre>
  
  <p>But I am getting error code <strong>6004</strong> which is <strong>STATUS_MULTIPLAYER_ERROR_INVALID_OPERATION</strong></p>
  
  <p><strong>This multiplayer operation is not valid, and the server rejected it. Check the logs for more information.</strong></p>
  
  <p>I think it's because of the <strong>addPlayersToInvite</strong> method because I read the following in the android docs...</p>
  
  <pre><code>public RoomConfig.Builder addPlayersToInvite (String... playerIds)
  
  Add one or more player IDs to invite to the room. This should be set only when calling create(GoogleApiClient, RoomConfig)
  
  Parameters
  playerIds   One or more player IDs to invite to the room.
  Returns
  The builder instance.
  </code></pre>
  
  <p>Note how it says <strong>this should only be set when calling create(GoogleApiClient, RoomConfig)</strong> but I dont know how to call method or what to do.</p>
  
  <p>So my question basically is this: I have the id of the player I have invited, I now want to create a room for the player and me. How can I do this?</p>