Skip to main content
Version: 5.9.0

RegisterListenersForFriends

Registers the caller for RTT presence updates from friends on the given platform. Can be one of "all", "brainCloud", or "facebook". If bidirectional is set to true, then also registers the targeted users for presence updates from the caller.

ServiceOperation
presenceREGISTER_LISTENERS_FOR_FRIENDS

Method Parameters

ParameterDescription
platformPresence for friends of the caller on the specified platform. Use "all" or omit for all platforms.
bidirectionalShould those profiles be mutually registered to listen to the current profile?

Usage

http://localhost:3000
string platform = "brainCloud";
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.RegisterListenersForFriends(platform, bidirectional, successCallback, failureCallback);
JSON Response
{
"data": {
"presence": [
{
"user": {
"id": "7630f98e-1236-4ead-88ee-27ce63b2db2c",
"name": "",
"pic": null,
"cxs": [
"22284:fb416888-e76d-425d-a06d-a5529bdba8d9:id58ohotujj893gomctos244al"
]
},
"online": true,
"summaryFriendData": {},
"activity": {
"LOCATION": "POKER_TABLE",
"STATUS": "PLAYING_GAME"
}
}
]
},
"status": 200
}