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
Swift Package Manager (Recommended)
- In Xcode, select File > Add Package Dependencies...
- Enter the repository URL:
https://github.com/withyoursquad/squad-sports-ios.git
- Select version settings:
- Rules: Version - Up to Next Major
- Version: 1.0.0 or later
CocoaPods
- Add to your Podfile:
pod 'SquadSDK', '~> 1.0.0'
- 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
- Installation & Setup - Detailed installation steps
- Configuration Guide - Advanced SDK configuration
- WebView Management - WebView integration and management
- User Authentication - Authentication implementation
- WebView Events - Event handling guide
Troubleshooting
For common issues and solutions, see our Troubleshooting Guide.
Additional Resources
Support
Need help? Our support team is ready to assist:
- Support Center: https://support.squadforsports.com
- Email: support@squadforsports.com
- Documentation: https://docs.squadforsports.com