Class GamingSquad
Representation of a group of players playing together in a Messenger thread.
Inherited Members
Namespace: Meta.InstantGames
Assembly: Unity.Meta.InstantGames.Sdk.dll
Syntax
public class GamingSquad : JsObject
Constructors
GamingSquad()
Construct an instance of GamingSquad
Declaration
public GamingSquad()
Methods
AddToSquadAsync(AddToGamingSquadPayload)
Brings up a dialog for the player to add their friends to the current squad. Exceptions: INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE, USER_INPUT
Declaration
public WebTask AddToSquadAsync(AddToGamingSquadPayload payload = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AddToGamingSquadPayload | payload | Represents parameters used to configure the Add to Squad dialog. |
Returns
| Type | Description |
|---|---|
| WebTask | A WebTask that completes when the user closes the dialog. |
GetContextID()
Gets the unique gaming squad context ID.
Declaration
public string GetContextID()
Returns
| Type | Description |
|---|---|
| string | The gaming squad context ID. |
GetID()
Gets the unique gaming squad ID.
Declaration
public string GetID()
Returns
| Type | Description |
|---|---|
| string | The gaming squad ID. |
GetImage()
Gets the URI for the gaming squad image.
Declaration
public string GetImage()
Returns
| Type | Description |
|---|---|
| string | The URI for the gaming squad image. |
GetName()
Gets the gaming squad name.
Declaration
public string GetName()
Returns
| Type | Description |
|---|---|
| string | The gaming squad name. |
JoinAsync(JoinGamingSquadPayload)
Brings up a dialog for the player to join the squad if they are not part of it. If the user accepts, they become part of the squad thread, and the game context switches into the squad. If they are part of the squad already, the dialog prompts the user to switch into the squad context. Exceptions: INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE, USER_INPUT
Declaration
public WebTask JoinAsync(JoinGamingSquadPayload payload = null)
Parameters
| Type | Name | Description |
|---|---|---|
| JoinGamingSquadPayload | payload | Represents parameters used to configure the Join dialog. |
Returns
| Type | Description |
|---|---|
| WebTask | A WebTask that completes when the user closes the dialog. |
LeaveAsync(LeaveGamingSquadPayload)
Brings up a dialog for the player to confirm if they want to leave the squad. If the player confirms, they are removed from the squad and the associated Messenger thread. Exceptions: INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE, USER_INPUT
Declaration
public WebTask LeaveAsync(LeaveGamingSquadPayload payload = null)
Parameters
| Type | Name | Description |
|---|---|---|
| LeaveGamingSquadPayload | payload | Represents parameters used to configure the Leave dialog. |
Returns
| Type | Description |
|---|---|
| WebTask | A WebTask that completes when the user closes the dialog. |