message.comDevelopers

iOS SDK Coming soon

Native iOS SDK for embedding the message.com chat surface inside your iPhone and iPad app. Swift-first, SwiftUI and UIKit compatible, iOS 15+. Mirrors the web JavaScript API so your team can apply what they already know.

The native iOS SDK is committed but unscoped. The widget already works inside a WKWebView today; treat that as the path until the native SDK ships.

Installation

The SDK ships via Swift Package Manager. CocoaPods and Carthage support land in the same release window. The binary is shipped as an XCFramework with arm64 and arm64-simulator slices.

Package.swift
// In Xcode: File → Add Packages...
// Or in Package.swift:
dependencies: [
    .package(url: "https://github.com/message-com/message-ios", from: "1.0.0"),
]

Initialise

Call Message.configure once during app launch. The SDK starts a background connection only when the chat surface is opened, to avoid impact on cold-start time.

App.swift
import MessageCom

@main
struct AcmeApp: App {
    init() {
        Message.configure(workspaceId: "abc123")
    }
    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

Identify the user

Just like the web SDK, call identify as soon as you know who the user is. Pass a server-computed userHash to prevent impersonation. See the identifying visitors guide for how to compute the hash.

AuthFlow.swift
// Inside your auth flow, after sign-in completes:
Message.shared.identify(
    userId: user.id,
    email: user.email,
    name: user.fullName,
    userHash: user.messageUserHash   // HMAC, computed server-side
)

Open the chat surface

The SDK presents chat as a sheet on top of your current view. You can also embed it as a child controller if you want chat as a tab in your app.

HelpButton.swift
import MessageCom
import SwiftUI

struct HelpButton: View {
    var body: some View {
        Button("Talk to support") {
            Message.shared.open()
        }
    }
}

Push notifications

When an agent replies and the user is backgrounded, we send a push via your APNs key. Register the device token from the standard AppDelegate callback.

AppDelegate.swift
// AppDelegate
func application(
    _ application: UIApplication,
    didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data
) {
    Message.shared.register(deviceToken: deviceToken)
}

UI customisation

  • Tint colour follows your workspace primary unless overridden via Message.shared.tintColor.
  • Light and dark modes follow the user's system setting.
  • Localisation pulls from your workspace language settings; you can override with Message.shared.locale.
  • Full SwiftUI MessageView available for fully custom embedding.

App Store privacy manifest

The SDK ships a PrivacyInfo.xcprivacy manifest declaring the data classes we collect (customer support data) and the reason codes for API usage. You inherit this manifest automatically; no copy work required.

Common pitfalls

  • Do not embed a stale userHash. Compute it server-side per session.
  • Configure App Transport Security correctly if you proxy to a custom domain. The default ATS settings work for app.message.com.
  • Push tokens are environment-specific. Use the sandbox APNs key for TestFlight, production for App Store.