LeaveGroupAuto
Leave a group in which the user is a member. If member is OWNER, a new owner is automatically selected: most recently active ADMIN; otherwise, most recently active MEMBER; otherwise, group is deleted.
Service | Operation |
---|---|
group | LEAVE_GROUP_AUTO |
Method Parameters
Parameter | Description |
---|---|
groupId | The id of the group. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string groupId = "a-group-id";
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.GroupService.LeaveGroupAuto(groupId, successCallback, failureCallback);
const char *groupId = "a-group-id";
_bc.getGroupService().leaveGroupAuto(groupId, this);
NSString *groupId = @"a-group-id";
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc groupService] leaveGroupAuto:
groupId:groupId
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil]
String groupId = "a-group-id";
this; // implements IServerCallback
_bc.getGroupService.leaveGroupAuto(groupId, this);
public void serverCallback(ServiceName serviceName, ServiceOperation serviceOperation, JSONObject jsonData)
{
System.out.print(String.format("Success | %s", jsonData.toString()));
}
public void serverError(ServiceName serviceName, ServiceOperation serviceOperation, int statusCode, int reasonCode, String jsonError)
{
System.out.print(String.format("Failed | %d %d %s", statusCode, reasonCode, jsonError.toString()));
}
var groupId = "a-group-id";
_bc.group.leaveGroupAuto(groupId, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var groupId = "a-group-id";
ServerResponse result = await _bc.groupService.leaveGroupAuto(groupId:groupId);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var groupId = "a-group-id";
var groupProxy = bridge.getGroupServiceProxy();
var postResult = groupProxy.leaveGroupAuto(groupId);
{
"service":"group",
"operation":"LEAVE_GROUP_AUTO",
"data":{
"groupId":"a-group-id"
}
}
JSON Response
{
"status": 200,
"data": {}
}