OpenIM Flutter SDK overview
Integrate user, conversation, group, message, calling, and event capabilities into your Flutter app with the OpenIM Flutter SDK.
The OpenIM Flutter SDK delivers native instant messaging capabilities for cross-platform Flutter applications. The package is published on pub.dev as flutter_openim_sdk. Access all core capabilities—including initialization, user profiles, relationship chains, conversations, groups, messages, and audio/video calling signaling—globally through OpenIM.iMManager.
The OpenIM Flutter SDK provides a comprehensive set of Dart APIs, strongly-typed data models, and listener callbacks tailored for Flutter applications. Always use the paginated APIs when retrieving friend and conversation lists.
Integration workflow
- Add the
flutter_openim_sdkdependency from pub.dev. - Retrieve the current user's
userID, token, and OpenIMServer endpoints from your business backend. - Initialize the SDK and monitor connection, token expiration, and kick-out states via
OnConnectListener. - Once login succeeds and the connection is established, invoke user, friend, conversation, group, message, and call signaling APIs.
- Merge incremental changes received from listeners into application state using stable entity identifiers. When switching accounts, clear state from the previous account.
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
final openIM = OpenIM.iMManager;Documentation structure
| Domain | Description |
|---|---|
| Environment-specific implementation | Platform setup, authentication, connection lifecycle, and sending your first message. |
| Users overview | User profiles, relationship chains, friend applications, blocklists, and online presence. |
| Conversations overview | Conversation queries, configurations, conversation groups, drafts, unread counts, hiding, and deletion. |
| Groups overview | Group profiles, member management, join applications, role permissions, and group events. |
| Messages overview | Creating, sending, receiving, querying, searching, modifying, pinning, transcribing, revoking, and read receipts. |
| Audio & video calls overview | Call signaling, room credentials, custom signals, and call events. |
| Events overview | Manager listeners, lifecycle events, and initial synchronization. |
Key data boundaries
- When sending single-chat messages, supply
userID. When sending group-chat messages, supplygroupID. Never provide both targets simultaneously. ConversationInfostores conversation display data, unread counts, drafts, and notification receive settings.GroupInfoandGroupMembersInfomanage group metadata and member relations.- Listeners notify subsequent incremental changes. When entering a screen for the first time, proactively query the initial snapshot, then merge subsequent updates using
userID,conversationID,groupID, orclientMsgID.
Pure query Futures return the snapshot required by the screen at invocation time and do not trigger shared events. Treat state-changing method completion, listener events, and query recalibration as three distinct stages.
References
Was this page helpful?