OpenIM Flutter SDK overview
Add users, conversations, groups, messages, calls, and events to a Flutter app with the OpenIM Flutter SDK.
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
- Add the dependency from pub.dev.
- Obtain the current user's
userID, token, and OpenIMServer addresses from the application backend. - Initialize the SDK and handle connection, token, and forced-sign-out states through
OnConnectListener. - After login succeeds and the connection is available, call the user, friend, conversation, group, message, and call-signaling APIs.
- 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
| Domain | Coverage |
|---|---|
| Getting started | Platform integration, authentication, connection lifecycle, and sending the first message. |
| Users | User profiles, friends, blocklist, and online status. |
| Conversations | Conversation queries, settings, groups, drafts, unread counts, hiding, and deletion. |
| Groups | Group profiles, members, applications, permissions, and group events. |
| Messages | Creating, sending, receiving, querying, searching, editing, pinning, transcribing audio, revoking, and read receipts. |
| Audio and video calls | Call signaling, room credentials, custom signals, and call events. |
| Events | Manager listeners and initial synchronization. |
Key data boundaries
- For a one-to-one message, provide
userID; for a group message, providegroupID. Do not specify both destinations. ConversationInfostores the conversation's display information, unread count, draft, and receive setting.GroupInfoandGroupMembersInforepresent 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, orclientMsgID.
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
Was this page helpful?