docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GamingSquad

    Representation of a group of players playing together in a Messenger thread.

    Inheritance
    object
    JsObject
    GamingSquad
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)