Browse SDKs · Flutter
Platform
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.

This documentation covers the Dart APIs, models, enums, and listeners provided by the OpenIM Flutter SDK. Friend and conversation lists use the paginated APIs.

Integration flow

  1. Add the dependency from pub.dev.
  2. Obtain the current user's userID, token, and OpenIMServer addresses from the application 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.

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