Skip to main content
Version: 5.7.0

AutoJoinGroupMulti

Find and join an open group in the pool of groups in multiple group types provided as input arguments.

  • isOpenGroup - the isOpenGroup flag is set on group creation, or via the SetGroupOpen method.

AutoJoinStrategy is defined by enum or constant in most of the client libraries. For those that take a string, these are the valid values:

  • JoinFirstGroup - Joins the first group found that matches the specified criteria.
  • JoinRandomGroup - Finds all groups that matches the specified criteria and then randomly chooses one to join.
ServiceOperation
groupAUTO_JOIN_GROUP_MULTI

Method Parameters

ParameterDescription
groupTypesThe list of group types to draw candidates from
autoJoinStrategySelection strategy to employ when there are multiple matches
whereQuery parameters (optional)

Usage

http://localhost:3000
string[] groupTypes = {"type1","type2"};
AutoJoinStrategy autoJoinStrategy = AutoJoinStrategy.JoinRandomGroup;
string where = "{}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.Group.AutoJoinGroupMulti(groupTypes, autoJoinStrategy, where, successCallback, failureCallback);
JSON Response
{
"status": 200,
{
"data": {
"groupType": "test",
"groupId": "972e245c-38e8-4ccb-84db-8be5f530a27a",
"memberCount": 3,
"name": "Test2",
"invitedPendingMemberCount": 0,
"requestingPendingMemberCount": 0,
"ownerId": "1b8c0719-6f2e-44a0-95a2-bae46a4c5278",
"summaryData": null,
"isOpenGroup": true
},
}
}