iOS Installation & Setup
Requirements
- iOS 13.0 or later
- Xcode 13.0 or later
- Swift 5.3 or later
Installation Methods
Swift Package Manager (Recommended)
- In Xcode, select File > Add Package Dependencies...
- Enter the Squad SDK 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 the following to your Podfile:
platform :ios, '13.0'
use_frameworks!
target 'YourApp' do
pod 'SquadSDK', '~> 1.0.0'
end
- Install the dependency:
pod install
Project Setup
1. Required Permissions
Add the following to your Info.plist:
<!-- Microphone permission for voice calls -->
<key>NSMicrophoneUsageDescription</key>
<string>Squad needs access to your microphone for voice calls.</string>
<!-- Camera permission for profile photos (optional) -->
<key>NSCameraUsageDescription</key>
<string>Squad needs access to your camera for profile photos.</string>
2. Background Modes
Enable the following capabilities in Xcode:
- Go to your target's Signing & Capabilities
- Click + Capability
- Add Background Modes
- Enable:
- Voice over IP
- Audio, AirPlay, and Picture in Picture
- Background fetch
3. Network Configuration
Add App Transport Security settings to Info.plist:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSExceptionDomains</key>
<dict>
<key>squadforsports.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<false/>
<key>NSExceptionRequiresForwardSecrecy</key>
<true/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.3</string>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
4. Framework Dependencies
The Squad SDK requires the following frameworks:
- WebKit.framework
- AVFoundation.framework
- Network.framework
These are automatically linked when using package managers.
Post-Installation Steps
1. Import the SDK
Add the import statement to your source files:
import SquadSDK
2. Initialize the SDK
In your AppDelegate or SceneDelegate:
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Initialize Squad SDK
do {
try SquadSDK.initialize(
organizationId: "YOUR_ORG_ID",
apiKey: "YOUR_API_KEY"
)
} catch {
print("Squad SDK initialization failed: \(error)")
}
return true
}
3. Verify Installation
Add a test implementation:
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Verify SDK version
print("Squad SDK Version: \(SquadSDK.version)")
// Check initialization status
if SquadSDK.shared.isInitialized {
print("Squad SDK initialized successfully")
}
}
}
Troubleshooting
Common Issues
-
Pod Installation Failed
-
Run
pod repo update - Delete Podfile.lock and run
pod installagain -
Check minimum iOS version in Podfile
-
SPM Installation Failed
-
Check Xcode version compatibility
- Clear derived data
-
Update to latest Xcode version
-
Framework Not Found
- Clean build folder (Cmd + Shift + K)
- Clean build cache
- Re-run package manager installation
Support
For installation issues:
- Check our troubleshooting guide
- Visit our support center
- Contact support at support@squadforsports.com
Next Steps
- Configure the SDK using the Configuration Guide
- Set up user authentication with User Auth Guide
- Integrate WebView using WebView Management