RegisterListenersForGroup
Registers the caller for RTT presence updates from the members of the given groupId. Caller must be a member of said group. If bidirectional is set to true, then also registers the targeted users for presence updates from the caller.
| Service | Operation |
|---|---|
| presence | REGISTER_LISTENERS_FOR_GROUP |
Method Parameters
| Parameter | Description |
|---|---|
| groupId | Target group ID. |
| bidirectional | Should those profiles be mutually registered to listen to the current profile? |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
string groupId = "aaa-bbb-ccc-ddd";
bool bidirectional = 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.RegisterListenersForGroup(platform, bidirectional, successCallback, failureCallback);
const char* groupId = "aaa-bbb-ccc-ddd";
bool bidirectional = true;
_bc->getPresenceService()->registerListenersForGroup(platform, bidirectional, this);
NSString* groupId = @"aaa-bbb-ccc-ddd";
bool bidirectional = true;
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc presenceService] registerListenersForGroup:platform
bidirectional:bidirectional
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String groupId = "aaa-bbb-ccc-ddd";
boolean bidirectional = true;
this; // implements IServerCallback
_bc.getPresenceService().registerListenersForGroup(platform, bidirectional, 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 = "aaa-bbb-ccc-ddd";
var bidirectional = true;
_bc.presence.registerListenersForGroup(platform, bidirectional, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var groupId = "aaa-bbb-ccc-ddd";
var bidirectional = true;
ServerResponse result = await _bc.presenceService.registerListenersForGroup(groupId:groupId, bidirectional:bidirectional);
if (result.statusCode == 200) {
print("Success");
} else {
print("Failed ${result.error['status_message'] ?? result.error}");
}
var groupId = "aaa-bbb-ccc-ddd";
var bidirectional = true;
var postResult = presenceProxy.registerListenersForGroup(platform, bidirectional);
if (postResult.status == 200) {
// Success!
}
{
"service": "presence",
"operation": "REGISTER_LISTENERS_FOR_GROUP",
"data": {
"groupId": "aaa-bbb-ccc-ddd",
"bidirectional": true
}
}
JSON Response
{
"data": {
"presence": [
{
"user": {
"id": "aaa-bbb-ccc-ddd",
"name": "",
"pic": null,
"cxs": [
"22284:fb416888-e76d-425d-a06d-a5529bdba8d9:id58ohotujj893gomctos244al"
]
},
"online": true,
"summaryFriendData": {},
"activity": {
"LOCATION": "POKER_TABLE",
"STATUS": "PLAYING_GAME"
}
}
]
},
"status": 200
}