PENDING
: The Live Match has not yet started. Any member of the Room can join the game.RUNNING
: The Live Match has started. Depending on the type of your game, any members that join the
match during this phase should either be allowed to join or placed into a spectator mode.CONCLUDED
: The Live Match has ended. The Room will handle player exit from the Live Match.ABANDONED
: All players in a pending Live Match exited the game before it started.<script src="https://connect.facebook.net/en_US/fbinstant.beta.js"></script>
Learn more about how to Create a Business Manager and how to Verify a Business.
When a game is started in a Room, everyone who joins the game expects to be able to play the game together in real- time. Your game must follow the guidelines in this section to provide a consistent experience across all Instant Games.
COMPLETED
state or the Room call ends.At load time, your game should call FBInstant.room.getCurrentMatchAsync
and respond as follows:
LiveMatch
object, the game is now in a LiveMatch and should satisfy the behavioral requirements for a real-time match in a Room.We do not support the Unity game engine for Play Together. Also refer to Load Times and Performance for more recommendations.
When your game detects that a Live Match is in progress, you can call LiveMatch.getContextID
to get the social context ID associated with the Live Match. The social context ID will match the current context that is returned from the Room environment when you call FBInstant.context.getID
.
All players whose Live Match is associated with the same social context ID must be grouped together in a single game match.
When the minimum number of players have joined the match, your game should allow a player to start the match. Your game has a discretion over which players can start the match. For example, you can allow any player to start the match, or allow only the first player to enter the match context (that is, the player who initiated the game in the Room) to start the match.
When the match has started in-game, your game server should use the following POST
request to signal to the platform that the match has started. This will set the Match Status to RUNNING
:
POST https://graph.facebook.com/{live-match-id}/start_match?access_token={APP_ACCESS_TOKEN}
Response
{
"success": true
}
When the match has ended in-game, the game server should use the following POST
request to signal to the platform that the match has ended. This will set the Match Status to CONCLUDED
.
POST https://graph.facebook.com/{live-match-id}/end_match?access_token={APP_ACCESS_TOKEN}
Response
{
"success": true
}
Your game can also access the list of players who are actively in the match by calling LiveMatch.getActiveParticipantsAsync()
.