WuKongIM Docs

WuKongEasySDK

Choose an iOS, Android, Flutter, Web, C#, C++, Rust, or Python quickstart with pinned versions or source for Alice/Bob online messaging.

WuKongEasySDK uses WebSocket JSON-RPC CONNECT for a lightweight connection and online-messaging API. It fits applications that already have a product backend and own their UI and product state.

Choose a platform and send the first message

After the platform tutorial, Alice and Bob will connect separately, exchange a text JSON payload in a person Channel, then remove listeners and connections on exit.

Check whether it fits

Choose EasySDK when you only needChoose the full WuKongIMSDK when you also need
WebSocket connection and automatic reconnectA local message database and offline recovery
Online messages in person or group ChannelsConversations, unread counts, and message synchronization
Send results and realtime message eventsPush, multi-device behavior, and the broader platform API
Product-owned UI, persistence, and receiptsMore client message state owned by the SDK

EasySDK is neither a chat UI nor a complete product backend. A successful send means the server returned a send result; it does not mean the peer received, displayed, or processed the message. If you need the broader feature set, return to SDK selection.

Rust uses one Client per identity; clones share the socket. subscribe() returns a bounded receiver, disconnect().await permits later connection, and destroy().await closes permanently. The default device category is PC 2. See the Rust quickstart for installation and lifecycle.

Before you begin: get connection material from your backend

The client must not create its own identity or call Product HTTP management routes. After product login, the trusted backend returns the minimum connection material over HTTPS:

{
  "uid": "alice",
  "token": "short-lived-token",
  "websocketUrl": "wss://im.example.com/ws"
}
FieldOwner and constraint
uidStable user identity confirmed by the product backend; Alice and Bob use different values
tokenShort-lived and revocable, scoped to this identity's connection, with no Product HTTP management authority
websocketUrlSelected by the backend from deployment configuration or a trusted routing result; production uses wss://

Complete Authentication & Tokens first. The default composition exactly matches each CONNECT token against the /user/token record for the same UID and device category. Your deployment must still protect that route, implement expiry and rotation policy, and prove that invalid, revoked, and product-expired tokens are rejected.

Alice/Bob acceptance loop

All platforms follow the same minimal path:

  1. Obtain separate uid, short-lived token, and websocketUrl values for Alice and Bob.
  2. Create the clients in two independent devices, processes, or browser contexts by following the platform quickstart.
  3. After both sides report a successful connection, have Alice send a text JSON payload to the person Channel bob.
  4. Retain Alice's send result; on Bob, verify fromUid, the Channel, and the payload in the realtime message event.
  5. Send from Bob to Alice and prove the reverse direction.
  6. Leave the page or sign out, remove listeners, and disconnect; confirm there is no duplicate event or background connection.

This loop verifies online messaging only. Send acknowledgement, realtime receipt, and product completion are three different states; model them with Messaging.

To validate the environment first, follow Run the Official Examples with the verified server and client revisions before moving tutorial code into your application.

Lifecycle differences across platforms

TaskiOSAndroidFlutterWebC#
Create and initializeApplication-owned WuKongEasySDK instanceProcess singleton via getInstance() + initApplication-owned singleton + initOne WKIM instance per identity or browser contextIndependent WKIM instance
Listener ownershipRetain each EventListener tokenRetain the same listener objectRetain the same callback referencePass the same function reference to on and offUse the same delegate with += / -=
Allow sendAfter onConnectAfter CONNECTAfter the connect eventAfter the Connect eventAfter ConnectAsync succeeds
Account exitRemove tokens and disconnectRemove listeners and disconnect; account switching must handle the singleton limitRemove listeners, disconnect, then disposeoff, then destroyAwait DisposeAsync / await using

A view may subscribe to connection state, but rebuilding the view must not create a second connection. Each platform's complete minimal example shows the correct owner and cleanup point.

C++ uses an independent WKIM instance and I/O thread. Retain ListenerId values, remove listeners at exit, and wait for disconnect() / destroy() to finish. Callbacks must never wait on SDK futures; dispatch UI and slow work to the application executor. See the C++ quickstart.

Complete before production

  • Use WSS and verify certificates, reverse-proxy WebSocket Upgrade, and device-side reachability.
  • Prove that expired, revoked, wrong-identity, and replayed tokens are rejected.
  • Keep SDK diagnostics disabled in Release builds, then use non-production canaries to inspect device logs, the browser Console, crash reports, and collectors.
  • Accept reconnect, offline recovery, deduplication, push, multi-device behavior, capacity, observability, upgrades, and rollback separately.
  • Record the server revision, SDK version, platform, device, and network instead of treating one development loop as a production receipt.

Use Release Checks to close these gates.

Versions and evidence

All four source examples and released packages have run successfully

On August 31, 2026, all four official examples completed source runs against WuKongIM 5676700d2dc966fa6fc9b2f0620a6ae429adad5a. On September 1, npm 2.0.4, Maven Central 1.0.5, CocoaPods 1.1.1, and pub.dev 1.1.0 then connected to test-merge server 35f314cc2512f3f0f5d55d9677e817cb64129985 for final PR head 1c9430f15fc8844e7025df07d54ab6e80e026414 and completed Alice/Bob online bidirectional messaging plus disconnect cleanup. See the hosted released-package run; the browser package also passed separately in Chrome 151. This is still not physical-device, WSS, offline, or production-token evidence.

PlatformVerified example revisionRelationship to the release
Weba055b3667247333b6b3183249f5d5929673dfd53Included in released v2.0.4
Android7134bbd0263fd01d9e7f71b7bd05b226f75b2292Included in released v1.0.5
iOS40014c16c0becd390c105098d359048901f4d87cIncluded in released v1.1.1
Flutter98ab8f3d9a1ad53f40c32caef0979845a37ae9a6The same source as released v1.1.0

Source and package runs remain separate evidence

The table above proves exact source examples; the released-package run proves the archives actually resolved from each registry. The patch releases now include those source fixes and pass package acceptance, but retain the source revision, package version, server revision, and runtime whenever recording a result.

Current released versions

PlatformPinned release and source revisionOfficial distribution
iOSv1.1.1 · ca688fcac2c4cd8d6f8e8163faf165376b520ba9Release · CocoaPods
Androidv1.0.5 · 61ae6dc6d0077b15e47cda1fd530296b97a06a7aRelease · Maven Central
Flutterv1.1.0 · 98ab8f3d9a1ad53f40c32caef0979845a37ae9a6Release · pub.dev
Webv2.0.4 · 9c03c98c725982fac224cd1d3b52456eae983975Release · npm

Released-package runtime evidence

PlatformExact registry artifactRuntimeResult
Webeasyjssdk@2.0.4Chrome 151; hosted Node.js peerBidirectional messaging, SENDACK, and disconnect passed
Androidcom.githubim:easysdk-android:1.0.5Android 14 / API 34 EmulatorMaven resolution, instrumentation bidirectional messaging, and disconnect passed
iOSWuKongEasySDK 1.1.1iOS SimulatorCocoaPods resolution, bidirectional messaging, and disconnect passed
Flutterwukong_easy_sdk 1.1.0iOS Simulatorpub.dev hosted resolution, bidirectional messaging, and disconnect passed

Application dependencies use only these exact versions—never latest or a broad version range. All four official releases include logging-security changes that leave diagnostics off by default and sanitize enabled output:

PlatformFix provenance
iOSPR #3 · b7ec4440b940539bee213f95a3be74948f4b9fb8
AndroidPR #3 · e984c7374a0e11f5d109ad3dbfdea599907735ff
FlutterPR #3 · d7758c301e5289ddfa09cd09b6976c2479584b1c
WebPR #6 · 3ebf505734c5b6764b30eac011f0b7a5024c89e8

The task sequence was calibrated from the legacy EasySDK overview, iOS, Android, Flutter, and Web pages. The released source and distributions above remain authoritative for APIs, versions, and security boundaries.

C# / NuGet integration

WuKongEasySDK-CSharp provides an independent .NET 8+ client through the WuKongEasySDK 1.0.0 NuGet package. Create it with new WKIM / WKIM.Init, authenticate with ConnectAsync, send with SendAsync, manage events with += / -=, and await DisposeAsync or use await using on exit. Its default device category is PC 2.

C# is available on nuget.org. Follow the C# quickstart to install exact version 1.0.0, or build a pinned project reference or local NuGet package. Its real-process verification uses WuKongIM 132e46209 and remains separate from the four historical registry-package receipts above.

C++ vcpkg and pinned source

The C++ repository has project version 0.1.0. This tutorial pins source 3e367a908f42385ab9306f9708b7456399cace7d, installed through the WuKongIM-maintained vcpkg Git registry or CMake source integration; no prebuilt SDK archive or inclusion in Microsoft’s curated catalog is claimed. It follows JS v2.0.4 and completed C++/C++ and C++/JS online bidirectional messaging, reconnect, invalid-token rejection, and presence cleanup against WuKongIM 132e46209d98fa0425cc0f88e7a97080cdad044d, plus separate WS/WSS protocol tests. See the C++ validation record for environment and scope. This source evidence is separate from the historical four-platform released-package acceptance above.

Next

First run the official examples, then choose a platform for application integration. If you need offline messages, conversations, unread state, or broader platform APIs, switch to the full SDK.

Python source integration

WuKongEasySDK-Python is project version 0.1.0, pinned at c8cf8b0e66b2b684fc30eecd0f2aac8c0e25c04a, using Python 3.11+ and asyncio. Install from source; there is no PyPI release yet. It completed Python/Python and actual JS 2.0.4 bidirectional messaging, heartbeat, reconnect, invalid-Token rejection, and online cleanup against WuKongIM 0348c0539bbee420a859439695acdac911afa854, a Token-authenticated 256-hash-slot single-node cluster. See the Python quickstart for steps and validation scope. This source evidence is independent of the historical four-platform package acceptance.

On this page