SDKsAndroid
Get subscribed user online status
Use getSubscribeOnlineUsersStatus() to retrieve online status for subscribed users.
OpenIMClient.getInstance().userInfoManager.getSubscribeOnlineUsersStatus(
new OnBase<List<UsersOnlineStatus>>() {
@Override
public void onSuccess(List<UsersOnlineStatus> states) {
mergeOnlineStates(states);
}
@Override
public void onError(int code, String error) {
recordStatusQueryFailure(code, error);
}
}
);This method does not accept user IDs or modify the subscription set. The callback returns the current subscribed-user List<UsersOnlineStatus> snapshot, which can reconcile status by userID after reconnecting or reopening a screen.
The query does not trigger onUserStatusChanged. Apply the snapshot only to presence state; retrieve names and avatars through the user profile APIs.
Was this page helpful?