Browse SDKs · Flutter
Platform
SDKsFlutter

Unsubscribe from user status

Cancel presence status subscriptions for specified users using the OpenIM Flutter SDK.

Copy

Cancel online presence subscriptions for target users and release subscription capacity:

Parameters

ParameterTypeRequiredDescription
userIDsList<String>YesList of user IDs to unsubscribe from presence tracking.

Code example

await OpenIM.iMManager.userManager.unsubscribeUsersStatus(
  ['user_a', 'user_b'],
);

Return value

A successful Future returns void, indicating that the cancellation request was accepted by the server.

State changes after the call

This method alters subscription state. After successfully unsubscribing, the SDK ceases receiving incremental presence updates for these users. Once the Future resolves, remove these entries from your local presence cache using userID as the key; if the request fails, retain active subscription records for subsequent retry.

To subscribe to user presence, see Subscribe to user status. To retrieve an immediate presence snapshot, see Get subscribed user status.