SetVisibility
Update the presence data visible
field for the caller. An RTT event will be sent to any registered listeners of the caller with their updated presence info.
Service | Operation |
---|---|
presence | SET_VISIBILITY |
Method Parameters
Parameter | Description |
---|---|
visible | Should user appear in presence? True by default. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
bool visible = true;
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.PresenceService.SetVisibility(visible, successCallback, failureCallback);
bool visible = true;
this; // implements IServerCallback
_bc->getPresenceService()->setVisibility(visible, this);
bool visible = true;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc presenceService] setVisibility:visible
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
boolean visible = true;
this; // implements IServerCallback
_bc.getPresenceService().setVisibility(visible, 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 visible = true;
_bc.presence.setVisibility(visible, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var visible = true;
ServerResponse result = await _bc.presenceService.setVisibility(visible:visible);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var presenceProxy = bridge.getPresenceServiceProxy();
var visible = true;
var postResult = presenceProxy.setVisibility(visible);
if (postResult.status == 200) {
// Success!
}
{
"service": "presence",
"operation": "SET_VISIBILITY",
"data": {
"visible": true
}
}
JSON Response
{
"data": null,
"status": 200
}