Browse SDKs · Flutter
SDKsFlutter

OpenIM Flutter SDK overview

Add users, conversations, groups, messages, calls, and events to a Flutter app with the OpenIM Flutter SDK.

Copy

The OpenIM Flutter SDK connects Android and iOS Flutter apps to OpenIMSDK. The Dart package is published as flutter_openim_sdk. Application code uses OpenIM.iMManager to access initialization, user, friend, conversation, group, message, and audio and video call signaling capabilities.

The APIs, models, enums, and listeners in this documentation are based on the public Dart declarations of the OpenIM Flutter SDK. The guides cover only business APIs and events that have been verified. Deprecated methods and methods that immediately throw UnimplementedError are not recommended or documented as supported workflows. Friend and conversation lists use only the paginated APIs.

Integration flow

  1. Add the dependency from pub.dev.
  2. Obtain the current user's userID, token, and OpenIMServer addresses from a trusted backend.
  3. Initialize the SDK and handle connection, token, and forced-sign-out states through OnConnectListener.
  4. After login succeeds and the connection is available, call the user, friend, conversation, group, message, and call-signaling APIs.
  5. Merge listener increments into application state by stable identifiers, and clear state belonging to the previous account when users switch accounts.
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';

final openIM = OpenIM.iMManager;

Documentation structure

DomainCoverage
Getting startedPlatform integration, authentication, connection lifecycle, and sending the first message.
UsersUser profiles, friends, blocklist, and online status.
ConversationsConversation queries, settings, groups, drafts, unread counts, hiding, and deletion.
GroupsGroup profiles, members, applications, permissions, and group events.
MessagesCreating, sending, receiving, querying, searching, editing, pinning, transcribing audio, revoking, and read receipts.
Audio and video callsCall signaling, room credentials, custom signals, and call events.
EventsManager listeners and initial synchronization.

Key data boundaries

  • For a one-to-one message, provide userID; for a group message, provide groupID. Do not specify both destinations.
  • ConversationInfo stores the conversation's display information, unread count, draft, and receive setting. GroupInfo and GroupMembersInfo represent groups and their member relationships.
  • A listener reports incremental changes. When a page first opens, query a snapshot and then merge subsequent updates by userID, conversationID, groupID, or clientMsgID.
  • Tokens and room credentials are sensitive and must not be written to ordinary logs or uncontrolled storage.

A read-only Future returns the snapshot needed by the page; it does not trigger a shared event merely because it succeeded. Treat a state-changing method, its listener callback, and a reconciliation query as three separate stages.

References