Get subscribed user status
Retrieve presence snapshots for users currently subscribed to by the active account.
Invoke getSubscribeUsersStatus() to retrieve a presence snapshot of all users currently subscribed to by the active session. This method accepts no parameters.
Code example
import { getSubscribeUsersStatus } from '@/uni_modules/unix-openim-sdk'
const result = await getSubscribeUsersStatus()
const states = result?.statuses ?? []
states.forEach((state) => {
presenceByUserID.set(state.userID, state)
})Return value
The Promise resolves with an OpenIMUserStatusListResult | null object. The statuses array contains OpenIMUserStatusItem[] elements, each containing userID, aggregated status, and active platformIDs. For data property details, see Subscribe to online status.
State changes after the call
This is a read-only query that retrieves a local snapshot without modifying data or triggering presence events. If a user has not yet been subscribed to, call Subscribe to online status first. Do not assume an omitted user is offline; verify that a subscription exists for their ID.
Re-query this method when initializing presence views, recovering from network disconnection, or re-synchronizing application state. Real-time incremental transitions are streamed via onUserStatusChanged as detailed in Subscribe to online status.
Was this page helpful?