MobileIMSDK Documentation

repository·master·Indexed 26 days ago

https://github.com/jackjiang2011/mobileimsdk

A high-performance, lightweight, cross-platform IM communication framework supporting UDP, TCP, and WebSocket protocols. It decouples IM algorithms from application logic and supports Android, iOS, Java, H5, WeChat Mini Programs, Uniapp, HarmonyOS Next, and Flutter. Features include a Netty-based server implementation, QoS mechanisms for reliability, and support for C2C, C2S, and S2C message flows.

Tokens
11.8K
Snippets
34
Records
52
Agent score
91%

What's inside MobileIMSDK

  1. Overview of MobileIMSDK

    master

    MobileIMSDK is a cross-platform Instant Messaging (IM) communication layer framework designed to decouple the complexity of IM algorithms from application logic. It is a lightweight framework (core libraries under 50KB) that provides a unified API for three protocols: UDP, TCP, and WebSocket.

    Key Features:

    • Multi-Platform Support: Android, iOS, Java, H5, WeChat Mini Programs, Uniapp, HarmonyOS Next, and Flutter (community version).
    • Server-Side: High-performance server implementation based on Netty.
    • Interoperability: Seamlessly works with MobileIMSDK-Web for web-based chat and push notifications.
    • Use Cases: Chat applications, message pushing, and Enterprise OA (Office Automation) systems.
  2. Technical Features of MobileIMSDK

    master

    MobileIMSDK is a lightweight, high-performance IM framework with the following key features:

    • Protocol Support: Supports UDP, TCP, and WebSocket via a single API.
    • Multi-Platform: Supports iOS, Android, standard Java, H5, WeChat Mini Programs, Uniapp, and HarmonyOS NEXT.
    • Lightweight: The library package is under 50KB.
    • Reliability: Includes a QoS mechanism (automatic retransmission, message deduplication, status feedback) and automatic network detection/recovery.
    • Message Handling: Elegantly handles TCP sticky/half-packet issues at the lower layer, making them transparent to the application layer.
    • Performance: Optimized for high-latency and cross-continental environments. The server-side is based on Netty for high throughput.
    • Modes: Supports multiple real-time sensitivity modes to balance immediacy, traffic, and battery consumption.
  3. Install CocoaAsyncSocket

    master

    You can install CocoaAsyncSocket using CocoaPods, Carthage, or Swift Package Manager.

    ### CocoaPods
    Add to your Podfile:
    ```ruby
    use_frameworks! # Required for iOS 8+ or Swift
    pod 'CocoaAsyncSocket'

    Carthage

    Add to your Cartfile:

    github "robbiehanson/CocoaAsyncSocket" "master"

    Swift Package Manager

    Add to your Package.swift:

    dependencies: [
        .package(url: "https://github.com/robbiehanson/CocoaAsyncSocket", from: "7.6.4")
    ]
  4. Platform-specific Setup and API Documentation

    master

    MobileIMSDK provides dedicated guides and API documentation for various platforms. Use the following links to find the specific resources for your target environment:

    PlatformDevelopment GuideAPI DocumentationDemo Installation/Help
    AndroidGuideAPI DocsHelp
    iOSGuideAPI DocsHelp
    JavaGuideAPI DocsHelp
    H5GuideAPI DocsDemo
    WeChat Mini ProgramGuideAPI DocsDemo
    UniappGuideAPI DocsDemo
    HarmonyOS NextGuideAPI DocsHelp
    ServerGuideAPI DocsHelp
  5. Select an Application Scenario

    master

    Depending on your use case, you will need different message flows:

    • Chat Application (e.g., WeChat, QQ): Requires all three flows: C2C, C2S, and S2C. Note that developers must define their own application-layer logic and protocols.
    • Message Push: Requires only the S2C flow. This is the simplest implementation scenario.
    • Enterprise OA (Basic): For real-time pushing of instructions, documents, or applications. Requires only the S2C flow.
    • Enterprise OA (Enhanced): For real-time interaction of system/user-level messages. Uses C2C, C2S, and S2C flows.
  6. Access MobileIMSDK SDK binaries and source code

    master

    The repository contains pre-compiled binaries and source code for integration and study:

    • /sdk_binary: Contains pre-compiled core library files (lib) that can be directly referenced in your own projects.
    • /sdk_src: Contains the source code for the core libraries.
    • /demo_binary: Contains compiled Demo programs (including mobile clients and servers) for direct installation and testing.
    • /demo_src: Contains the full source code for all MobileIMSDK Demos.
  7. Install ProgressHUD via CocoaPods or Manually

    master

    You can integrate ProgressHUD into your iOS project using CocoaPods or by manual file inclusion.

    CocoaPods Add the following line to your Podfile:

    Manual Installation Copy the ProgressHUD.swift file directly into your Xcode project.

    pod 'ProgressHUD'
  8. Install DynamicBlurView

    master

    You can install DynamicBlurView using either CocoaPods or Carthage.

    #### CocoaPods
    
    Add the following to your `Podfile`:
    
    ```Ruby
    pod "DynamicBlurView"

    Carthage

    Add the following to your Cartfile:

    github "KyoheiG3/DynamicBlurView"