RemoveFriends
Unlinks the current user and the specified users as brainCloud friends.
Service | Operation |
---|---|
friend | REMOVE_FRIENDS |
Method Parameters
Parameter | Description |
---|---|
profileIds | Collection of profile IDs. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string[] profileIds = { "profileId1", "profileId2" };
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.FriendService.RemoveFriends(profileIds, successCallback, failureCallback);
std::vector<std::string> profileIds;
profileIds.push_back("profileId1");
profileIds.push_back("profileId2");
_bc->getFriendService()->removeFriends(profileIds, this);
NSArray *profileIds = @[ @"profileId1", @"profileId2" ];
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] removeFriends:profileIds
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String[] profileIds = { "profileId1", "profileId2" };
this; // implements IServerCallback
_bc.getFriendService().removeFriends(profileIds, 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 profileIds = [ "profileId1", "profileId2" ];
_bc.friend.removeFriends(profileIds, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var profileIds = [ "profileId1", "profileId2" ];
ServerResponse result = await _bc.friendService.removeFriends(profileIds:profileIds);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var profileIds = [ "profileId1", "profileId2" ];
var friendProxy = bridge.getFriendServiceProxy();
var postResult = friendProxy.removeFriends(profileIds);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "REMOVE_FRIENDS",
"data": {
"profileIds": [
"profileId1",
"profileId2"
]
}
}
JSON Response
{
"status": 200,
"data": null
}