Browse SDKs · Flutter
SDKsFlutter

Subscribe to user status

Subscribe to the online status of visible users with the OpenIM Flutter SDK.

Copy
final states =
    await OpenIM.iMManager.userManager.subscribeUsersStatus(targetUserIDs);
mergePresence(states);

Remove empty and duplicate IDs, and subscribe only to users currently visible in the UI. The Future returns the initial List<UserStatusInfo> snapshot; merge it by userID.

This page is the sole owner of onUserStatusChanged. Combine it into the application's single OnUserListener. When the user logs out or switches accounts, the application event dispatcher must isolate callbacks from the previous account.