SDKsAndroid
Refresh subscribed user status
Retrieve current presence states and active platforms for all subscribed users.
Retrieve a current presence snapshot for all users currently subscribed by this client. This is used to refresh screen states or calibrate presence data on demand.
Code example
OpenIMClient.getInstance().userInfoManager.getSubscribeOnlineUsersStatus(
new OnBase<List<UsersOnlineStatus>>() {
@Override
public void onSuccess(List<UsersOnlineStatus> states) {
// Render presence indicators using states
}
@Override
public void onError(int code, String error) {
// Handle error
}
}
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<List<UsersOnlineStatus>> | Yes | Callback delivering the asynchronous operation result. |
Return value
The successful callback returns the presence snapshot as List<UsersOnlineStatus>. Maintain your local cache using userID as the unique key:
| Field | Description |
|---|---|
userID | Target user ID. |
status | Presence status (1 for online, 0 for offline). |
platformIDs | List of active client platforms (such as Android, iOS, or Web platform codes). |
To subscribe to additional users or terminate existing subscriptions, see Subscribe to user status and Unsubscribe from user status.
Was this page helpful?