Managed UI Preview + Headless

iOS Swift SDK

Use the Swift SDK for native iOS apps that need Ringnity chat, AI, reports, and internet audio/video call flows. It includes an Easy/Managed UI preview for fast installs and a Headless object model for custom screens while low-level transport and media details stay inside the package.

Use this page for app implementation

iOS setup, Swift Package Manager, Managed UI SwiftUI, Headless object methods, microphone/camera permissions, APNs token registration, ringtone, and video view injection belong in this guide.

Use Scalar for REST details

Open Scalar when you need exact endpoint fields, response schemas, auth schemes, status codes, or generated client details.

Open Scalar API Reference

Chat

Create conversations, read messages, and send replies from a native iOS screen.

AI

Use AI request methods now and streaming callbacks when realtime support is enabled.

Calls

Create call sessions and let the SDK hide platform media setup.

Token flow

iOS apps receive short-lived runtime tokens from the customer backend. The backend stores the Server API key and can scope tokens to a visitor, agent, or admin workflow.

Package shape

Download the Swift source package from the SDK downloads page, then add its Package.swift through Swift Package Manager during pilot installs. The package exposes the RingnitySDK product.

Easy / Managed UI preview

Use this when the iOS app wants Ringnity to draw the support screen. The SwiftUI view includes Chat, AI, audio/video call controls, ringtone hooks, and optional video view injection.

import RingnitySDK
import SwiftUI

struct SupportView: View {
    let callAdapter = RingnityAppleCallAdapter()

    var body: some View {
        RingnityView(
            config: RingnityConfig(
                tokenProvider: fetchRingnityToken,
                callMode: .basic,
                mediaAdapter: callAdapter,
                notificationAdapter: callAdapter
            ),
            mode: .full,
            conversationSubject: "iOS customer support",
            remoteVideo: {
                YourRemoteVideoView()
            },
            localPreview: {
                YourLocalPreviewView()
            }
        )
    }
}

Headless Swift object model

let callAdapter = RingnityAppleCallAdapter()
let microphoneGranted = await RingnityAppleCallAdapter.requestMicrophonePermission()
let cameraGranted = await RingnityAppleCallAdapter.requestCameraPermission()

let ringnity = try await Ringnity.create(
    RingnityConfig(
        tokenProvider: {
            let token = try await customerBackend.fetchRuntimeToken()
            return RingnityRuntimeToken(
                token: token.token,
                expiresIn: token.expiresIn
            )
        },
        callMode: .basic,
        notifications: RingnityNotificationPreferences(
            incomingCall: RingnityRingtoneOptions(
                soundName: "ringnity_default",
                vibrate: true
            )
        ),
        mediaAdapter: callAdapter,
        notificationAdapter: callAdapter
    )
)

let readiness = try await ringnity.account.readiness()

let conversation = try await ringnity.chat.createConversation(
    subject: "Need help"
)
let conversationId = conversation["conversationId"] as! String

try await ringnity.devices.registerPushToken(
    platform: .ios,
    token: apnsToken,
    provider: .apns,
    audience: .customer,
    externalId: "customer-123",
    appId: "com.example.customer"
)

try await ringnity.chat.sendMessage(
    conversationId: conversationId,
    body: "Hi, I need help."
)

if microphoneGranted && cameraGranted {
    let call = try await ringnity.calls.startVideo(
        conversationId: conversationId
    )
    try await ringnity.notifications.previewRingtone()
    try await ringnity.notifications.stopRingtone()
    try await call.mute()
    try await call.setVideoEnabled(false)
    try await call.end()
}

let existingCall = try await ringnity.calls.getSession(
    callSessionId: "call-session-id"
)

Ringtone behavior

// Add iOS asset: ringnity_default.caf in the app bundle.

try await ringnity.notifications.previewRingtone()

try await ringnity.notifications.playIncomingRingtone()

// Stop when the customer answers, declines, or the call expires.
try await ringnity.notifications.stopRingtone()

Production readiness notes

The iOS SDK includes generated OpenAPI operation wiring, device push token registration, Swift Package Manager support, a native AVAudioSession call adapter, Managed UI preview, headless call session lookup, and a SwiftUI example. Production readiness work continues through device QA, optional CallKit integration, token exchange smoke testing, and a fuller iOS UI sample.

Open API Reference

Turn Your Website Into a Real-Time Call Center

Let customers call your team directly from your website, no phone numbers and no apps required. Just add one <script>.