Quick Start

Quick Start Guide

Get a working voice call in your iOS app in under 5 minutes.


Before You Begin

Make sure you have:

  • ✅ Xcode 15.0 or later
  • ✅ iOS 15.0+ target
  • ✅ A Kasookoo publishable key (get one at kasookoo.ai/signup)
  • ✅ A real iOS device (recommended; simulator has audio limitations)

Step 1: Install the SDK (1 minute)

Using Swift Package Manager (Recommended)

  1. Open your Xcode project
  2. Go to File → Add Package Dependencies
  3. Paste the URL:
    https://github.com/kasookoo/ios-sdk.git
  4. Choose Up to Next Major Version, starting from 1.0.0
  5. Click Add Package
  6. Select KasookooSDK target → Add Package

Manual Setup

Add to your Package.swift:

dependencies: [
    .package(url: "https://github.com/kasookoo/ios-sdk.git", from: "1.0.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: ["KasookooSDK"]
    )
]

Step 2: Configure Your App (2 minutes)

Add Required Capabilities

In Xcode, select your project → Signing & Capabilities tab → + Capability:

  1. ✅ Add Background Modes:

    • Check: Voice over IP
    • Check: Audio, AirPlay, and Picture in Picture
  2. ✅ Add Push Notifications (if using incoming calls)

Update Info.plist

Add the microphone permission:

<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access to make voice calls.</string>

Step 3: Initialize the SDK (1 minute)

In your app entry point or AppDelegate:

import SwiftUI
import KasookooSDK

@main
struct MyApp: App {
    @StateObject private var sdkManager = SDKManager()
    
    var body: some Scene {
        WindowGroup {
            ContentView()
                .environmentObject(sdkManager)
                .task {
                    await initializeSDK()
                }
        }
    }
    
    func initializeSDK() async {
        do {
            let config = KasookooConfig(
                publishableKey: "pk_test_YOUR_KEY_HERE",
                organizationId: "your_org_id",
                environment: .sandbox  // or .production
            )
            
            try await sdkManager.sdk.initialize(config: config)
            print("✅ SDK initialized")
        } catch {
            print("❌ SDK init failed: \(error)")
        }
    }
}

Step 4: Connect and Identify (1 minute)

After initialization, connect to backend and identify the user:

// Connect to backend (establishes session)
try await sdk.connect()

// Identify the current user
let profile = CallerProfile(
    name: "Alice Smith",
    email: "[email protected]",
    phoneNumber: "+1234567890",
    type: .customer
)

try await sdk.identify(callerProfile: profile)

Step 5: Make Your First Call (30 seconds)

let caller = Participant(
    name: "Alice Smith",
    email: "[email protected]",
    phoneNumber: "+1234567890",
    type: .customer
)

let callee = Participant(
    name: "Bob Agent",
    email: "[email protected]",
    phoneNumber: "+0987654321",
    type: .agent
)

let params = StartCallParams(
    roomName: "room_\(UUID().uuidString)",
    caller: caller,
    callee: callee
)

do {
    let call = try await sdk.call.start(params: params)
    print("📞 Call started: \(call.id)")
} catch {
    print("❌ Call failed: \(error)")
}

🎉 You Did It!

You now have a working voice call. Let's verify:

Check the Logs

You should see something like:

✅ SDK initialized
✅ Session created, TTL: 600s
✅ User identified: [email protected]
📞 Call started: <call-id>
✅ LiveKit: Connecting to room...
✅ Room connected
✅ Microphone enabled

Test in the Simulator

The call will initiate even on the simulator — you'll see the call state transition through:

initiating → ringing → connecting → connected

Note: Real audio requires a physical device.


Next Steps

Now that you have the basics working, explore more:

GuideWhat You'll Learn
Receiving CallsHandle incoming calls with CallKit
Push NotificationsSet up Firebase for incoming call pushes
MessagingSend and receive messages
Event HandlingSubscribe to SDK events
Error HandlingGracefully handle failures
Production ChecklistPrepare for App Store release

Need Help?


Common Issues

"SDK not initialized" error

Make sure you call initialize() before any other SDK method.

"Invalid publishable key" error

  • Double-check the key format: should start with pk_test_ or pk_live_
  • Verify the key in your Kasookoo Dashboard

Call connects but no audio

  • Verify microphone permissions granted
  • Test on a real device (not simulator)
  • Check Info.plist has NSMicrophoneUsageDescription

Build fails with "No such module 'KasookooSDK'"

  • Verify package is added in Package Dependencies
  • Clean build folder: Cmd+Shift+K
  • Restart Xcode

For more troubleshooting, see Troubleshooting Guide.


Did this page help you?