GetUsersOnlineStatus
Get the online status for a list of users based on profile ID.
Does not require the calling user to be a friend of the other user.
Service | Operation |
---|---|
friend | GET_USERS_ONLINE_STATUS |
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.GetUsersOnlineStatus(profileIds, successCallback, failureCallback);
std::vector<std::string> profileIds;
profileIds.push_back("profileId1");
profileIds.push_back("profileId2");
_bc->getFriendService()->getUsersOnlineStatus(profileIds, this);
NSArray *profileIds = @[ @"profileId1", @"profileId2" ];
BCCompletionBlock successBlock; // define callback
BCErrorCompletionBlock failureBlock; // define callback
[[_bc friendService] getUsersOnlineStatus:profileIds
completionBlock:successBlock
errorCompletionBlock:failureBlock
cbObject:nil];
String[] profileIds = { "profileId1", "profileId2" };
this; // implements IServerCallback
_bc.getFriendService().getUsersOnlineStatus(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.getUsersOnlineStatus(profileIds, result =>
{
var status = result.status;
console.log(status + " : " + JSON.stringify(result, null, 2));
});
var profileIds = [ "profileId1", "profileId2" ];
ServerResponse result = await _bc.friendService.getUsersOnlineStatus(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.getUsersOnlineStatus(profileIds);
if (postResult.status == 200) {
// Success!
}
{
"service": "friend",
"operation": "GET_USERS_ONLINE_STATUS",
"data": {
"profileIds": [
"profileId1",
"profileId2"
]
}
}
JSON Response
{
"status": 200,
"data": {
"onlineStatus": [
{
"isOnline": false,
"profileId": "d841da61-a49c-43f4-9937-a97339ccf0ec",
"userValid": true
}
]
}
}