docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GamingSquads

    Contains functions and properties related to gaming squads.

    Inheritance
    object
    JsObject
    GamingSquads
    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 GamingSquads : JsObject

    Constructors

    GamingSquads()

    Construct an instance of GamingSquads

    Declaration
    public GamingSquads()

    Methods

    CanUseSquadsAsync()

    Checks if the current player is eligible to use squads. Exceptions: INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE

    Declaration
    public WebTask<bool> CanUseSquadsAsync()
    Returns
    Type Description
    WebTask<bool>

    A WebTask<T> that resolves with true if the current player is eligible to use squads and false otherwise.

    CreateAsync(CreateGamingSquadPayload)

    Brings up a dialog for the player to create a GamingSquad. If the squad is created successfully, the WebTask<T> resolves with the new GamingSquad instance and the game session changes into this newly-created squad context. The WebTask<T> rejects if the player closes the dialog instead. Exceptions: INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE, USER_INPUT

    Declaration
    public WebTask<GamingSquad> CreateAsync(CreateGamingSquadPayload payload)
    Parameters
    Type Name Description
    CreateGamingSquadPayload payload

    Represents parameters used to configure a gaming squad.

    Returns
    Type Description
    WebTask<GamingSquad>

    A WebTask<T> containing a GamingSquad.

    GetAsync(string)

    Fetch an existing GamingSquad. If the squad doesn't exist or the player can't interact with it, this API rejects with the GAMING_SQUAD_NOT_FOUND error code. Exceptions: GAMING_SQUAD_NOT_FOUND, INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE

    Declaration
    public WebTask<GamingSquad> GetAsync(string id)
    Parameters
    Type Name Description
    string id

    The squad ID or context ID.

    Returns
    Type Description
    WebTask<GamingSquad>

    A WebTask<T> containing a GamingSquad.

    GetPlayerSquadsAsync()

    Fetches the current player's existing squads, if any. Exceptions: GAMING_SQUAD_NOT_FOUND, INVALID_OPERATION, INVALID_PARAM, NETWORK_FAILURE

    Declaration
    public WebTask<GamingSquad[]> GetPlayerSquadsAsync()
    Returns
    Type Description
    WebTask<GamingSquad[]>

    A WebTask<T> containing the current player's existing squads.

    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)