Skip to content

erxes/erxes-ios-sdk

erxes - IOS SDK

erxes iOS SDK is a secure, lightweight, and customizable iOS SDK that lets you embed a fully-featured customer messenger into your iOS application. Built on Swift and SwiftUI, it connects to the erxes platform and gives your users real-time chat, AI agent support, knowledge base access, and more — all inside your app.

Documentation | Join our community

Status

License Badge iOS 16+ Swift 5.9+ SPM Compatible Discord Twitter

Home Messages Tickets

Features

  • Real-time Messenger — Live chat powered by WebSocket with automatic reconnection and exponential backoff
  • AI Agent Support — Integrated bot conversations with typing indicators and persistent menus
  • Floating Launcher Button — Draggable MessengerLaunchButton that snaps to top-right or bottom-right corner
  • Attachment Uploads — Photo picker with upload progress thumbnails shown inline before the message sends
  • Instagram-style Timestamps — Swipe left to reveal per-message timestamps without leaving the conversation
  • Knowledge Base & FAQ — Browse and search your erxes knowledge base articles in-app
  • Tickets — Create and track support tickets directly from the messenger
  • Offline CachingCachedAsyncImage with NSCache + off-thread ImageIO downsampling; no UI-thread decode
  • Keyboard Native — Zero-lag keyboard avoidance via .safeAreaInset; no custom KeyboardObserver

Requirements

Platform:

  • iOS 16.0+
  • Xcode 15+

Swift:

  • Swift 5.9+

Dependencies (resolved via SPM):

erxes backend:

  • A running erxes instance with a configured Messenger integration
  • Your integrationId and server URL from the erxes admin panel

Installation

Swift Package Manager

In Xcode: File → Add Package Dependencies… and enter:

https://github.com/erxes/erxes-ios-sdk

Or add it directly to your Package.swift:

dependencies: [
    .package(url: "https://github.com/erxes/erxes-ios-sdk", from: "0.30.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: ["MessengerSDK"]
    )
]

Getting Started

1. Configure the SDK

Call this once at app launch (e.g. in your App initializer or AppDelegate):

import MessengerSDK

MessengerSDK.configure(
    MessengerConfig(
        endpoint: "https://your.erxes.instance",
        integrationId: "YOUR_INTEGRATION_ID"
    )
)

2. Identify the user (optional)

MessengerSDK.setUser(MessengerUser(
    email: "user@example.com",
    name: "Jane Doe"
))

3. Add the floating launcher button

The easiest way to expose the messenger is the draggable MessengerLaunchButton. Drop it as an overlay on your root view:

import MessengerSDK

struct ContentView: View {
    @ObservedObject private var sdk = MessengerSDK.shared

    var body: some View {
        YourRootView()
            .overlay {
                if sdk.isReady {
                    MessengerLaunchButton()
                        .transition(.scale(scale: 0.5).combined(with: .opacity))
                }
            }
            .animation(.spring(response: 0.4, dampingFraction: 0.7), value: sdk.isReady)
    }
}

The button snaps to the top-right or bottom-right corner — users can drag it between the two positions.

4. Or float the launcher from a UIKit / non-SwiftUI host

If your app isn't SwiftUI (UIKit, React Native, Flutter), call showLauncher() to float the same draggable button in a transparent overlay window above your content. Touches outside the button pass straight through, and it appears automatically once the connect handshake succeeds.

MessengerSDK.showLauncher()   // e.g. in AppDelegate / SceneDelegate after configure()
MessengerSDK.hideLauncher()   // remove it (e.g. on logout)

5. Or open the messenger programmatically

MessengerSDK.showMessenger(from: yourViewController)

Contributing

Please read our contributing guide and code of conduct before submitting a Pull Request to the project. To report a security issue, see our security policy.

Community Support

For general help using erxes, please refer to the erxes documentation. For additional help, you can use one of these channels:

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3). See the LICENSE file for licensing information.

About

erxes IOS SDK, for integrating erxes messenger to your iOS application

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages