Overview
This guide covers complete installation of the Stringboot iOS SDK, including analytics integration for A/B testing. Follow all steps to unlock the full capabilities of dynamic strings, translations, and experiments.A/B Testing Setup is Included: This guide includes analytics handler and device ID configuration required for experiments. These are core features, not optional add-ons.
Step 1: Add Swift Package Dependency
In Xcode, navigate to File → Add Packages and enter the repository URL:1.2.0
Alternative: Package.swift
Add to yourPackage.swift:
Package.swift
Step 2: Import SDK
In files where you use Stringboot:Step 3: Analytics Handler (Required for A/B Testing)
Why Analytics Integration is Required
The analytics handler enables:- Experiment tracking: Know which users see which variants
- Results analysis: Measure impact of string changes
- Data-driven decisions: Use analytics platforms for statistical analysis
- Firebase Analytics
- Mixpanel
- Amplitude
- Custom Analytics
Step 4: Device ID Configuration (Required for A/B Testing)
Why Device ID is Required
- Consistent assignments: Same device always gets same variant
- Cross-session persistence: Experiments persist across app restarts
- Accurate results: Users don’t switch between variants randomly
- Auto-Generated (Default)
- Firebase Installation ID
- Custom Device ID
SDK-Generated UUID (Recommended)
By default, the SDK generates a persistent UUID per app installation:App.swift
- Persists across app launches
- Unique per app installation
- Automatically managed by SDK
- Use this unless you have a specific reason to use custom ID
Step 5: Configure Logger (Optional)
Control SDK logging for debugging:App.swift
Complete Setup Example
Here’s a complete SwiftUI app with all components:App.swift
Step 6: Verify Setup
Test SDK Initialization
- Run your app with debug logging enabled
- Check Console for Stringboot initialization messages:
Test String Retrieval
Add a test in your ContentView:ContentView.swift
Test Experiment Assignment
If you have experiments running:Verify Analytics Integration
- Check your analytics platform (Firebase/Mixpanel/Amplitude)
- Look for user properties like
stringboot_exp_cta_test - Value should be variant name:
control,variant-a, etc.
Common Setup Issues
Build fails with package dependency error
Build fails with package dependency error
Cause: Package dependency conflict or incorrect versionSolution:
- File → Packages → Reset Package Caches
- Clean build folder (Cmd+Shift+K)
- Rebuild project
- Verify version is
1.2.0or higher
Analytics handler not called
Analytics handler not called
Possible causes:
- No experiments running in dashboard
- Analytics handler not passed to
initialize() - Device not assigned to any experiments
- Create test experiment in dashboard
- Verify
analyticsHandlerparameter is set - Check device ID is being sent with requests
Strings show '??key??' pattern
Strings show '??key??' pattern
Causes:
- API token invalid
- No network connectivity
- Strings not created in dashboard
- SDK not initialized yet
- Verify API token in dashboard
- Check network permissions
- Ensure strings exist for your app
- Wait for SDK
isReadybefore fetching
Device ID changes on each launch
Device ID changes on each launch
Cause: Using non-persistent ID or regenerating UUIDSolution:
- Use default SDK-generated UUID (it persists automatically)
- If using custom ID, store it in UserDefaults
- Don’t generate new UUID on each launch
'StringbootSDK' module not found
'StringbootSDK' module not found
Cause: Package not properly linkedSolution:
- File → Packages → Resolve Package Versions
- Check target has StringbootSDK in Frameworks
- Clean and rebuild
Platform Requirements
| Requirement | Version |
|---|---|
| Minimum iOS | 14.0+ |
| Minimum macOS | 11.0+ |
| Swift | 5.9+ |
| Xcode | 15.0+ |
| SDK Version | 1.2.0 |
Next Steps
Now that setup is complete, learn how to use the three core features:Dynamic Strings
Update app copy without releases
Translations
Multi-language support and switching
A/B Testing
Run experiments to optimize messaging
Additional Resources
Best Practices
Production-ready patterns
Advanced Usage
Advanced patterns and optimization
Core Concepts
Architecture and offline behavior
Troubleshooting
Common issues and solutions
Questions? Contact [email protected]