Browse SDKs · Flutter
Platform
SDKsFlutter

OpenIM Flutter SDK overview

Integrate user, conversation, group, message, calling, and event capabilities into your Flutter app with the OpenIM Flutter SDK.

Copy

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

  1. Add the flutter_openim_sdk dependency from pub.dev.
  2. Retrieve the current user's userID, token, and OpenIMServer endpoints from your business backend.
  3. Initialize the SDK and monitor connection, token expiration, and kick-out states via OnConnectListener.
  4. Once login succeeds and the connection is established, invoke user, friend, conversation, group, message, and call signaling APIs.
  5. 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

DomainDescription
Environment-specific implementationPlatform setup, authentication, connection lifecycle, and sending your first message.
Users overviewUser profiles, relationship chains, friend applications, blocklists, and online presence.
Conversations overviewConversation queries, configurations, conversation groups, drafts, unread counts, hiding, and deletion.
Groups overviewGroup profiles, member management, join applications, role permissions, and group events.
Messages overviewCreating, sending, receiving, querying, searching, modifying, pinning, transcribing, revoking, and read receipts.
Audio & video calls overviewCall signaling, room credentials, custom signals, and call events.
Events overviewManager listeners, lifecycle events, and initial synchronization.

Key data boundaries

  • When sending single-chat messages, supply userID. When sending group-chat messages, supply groupID. Never provide both targets simultaneously.
  • ConversationInfo stores conversation display data, unread counts, drafts, and notification receive settings. GroupInfo and GroupMembersInfo manage 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, or clientMsgID.

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