Skip to content

Getting Started with Squad SDK for iOS

This guide will help you integrate the Squad SDK into your iOS app, enabling social features and voice calling capabilities.

Prerequisites

Before you begin, ensure you have:

  • A Squad developer account and credentials
  • Xcode 13.0 or later
  • iOS 13.0 or later
  • Swift 5.3 or later

Installation Methods

  1. In Xcode, select File > Add Package Dependencies...
  2. Enter the repository URL:
https://github.com/withyoursquad/squad-sports-ios.git
  1. Select version settings:
  2. Rules: Version - Up to Next Major
  3. Version: 1.0.0 or later

CocoaPods

  1. Add to your Podfile:
pod 'SquadSDK', '~> 1.0.0'
  1. Install the dependency:
pod install

For detailed installation options and troubleshooting, see our Installation Guide.

Quick Start Guide

1. SDK Initialization

Import and initialize the SDK:

import SquadSDK

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    do {
        let config = SquadConfig(
            organizationId: "YOUR_ORG_ID",
            apiKey: "YOUR_API_KEY",
            environment: .production
        )
        try SquadSDK.initialize(with: config)
        print("Squad SDK initialized successfully")
    } catch {
        print("Failed to initialize Squad SDK: \(error)")
    }
    return true
}

For advanced configuration options, see our Configuration Guide.

2. User Authentication

Authenticate users using email or token:

try squadSDK.authenticateUser(
    identifier: "user@example.com",
    authType: .email
) { result in
    switch result {
    case .success(let user):
        print("User authenticated: \(user.id)")
    case .failure(let error):
        print("Authentication failed: \(error)")
    }
}

Learn more in our User Authentication Guide.

3. WebView Integration

Present the Squad experience:

class ViewController: UIViewController {
    func showSquadExperience() {
        do {
            let webView = try squadSDK.presentWebView(
                configuration: WebViewConfig(
                    features: [.voiceCalls, .freestyles, .polls]
                )
            )
            view.addSubview(webView)
            setupWebViewConstraints(webView)
        } catch {
            print("Failed to present Squad WebView: \(error)")
        }
    }
}

For comprehensive WebView management, see our WebView Management Guide.

Integration Guides

Troubleshooting

For common issues and solutions, see our Troubleshooting Guide.

Additional Resources

Support

Need help? Our support team is ready to assist: