Migration Notes & Changelog
This guide walks you through migrating from Gameball iOS SDK v2 to v3.1.0.What’s New in v3.1.0
Session Token Authentication — v3.1.0 introduces optional Session Token authentication for enhanced security, with automatic v4.1 endpoint routing. This is fully backward compatible with v3.0.0.
New Features in v3.1.0
- Session Token Support: Optional token-based authentication
- Automatic Endpoint Versioning: Routes to v4.1 API when a token is present
- Per-Request Token Override: Override the global token on individual API calls
- Thread-Safe Token Storage: In-memory token management using a dispatch queue
- Non-Breaking: All v3.0.0 code works unchanged
What’s New in v3.0.0
Modern Swift API
Native Swift API with improved type safety and better Swift idioms
Async/Await Support
Full async/await support alongside traditional callback-based APIs
Enhanced Type Safety
Stronger typing and better compile-time checks with Swift generics
Improved Performance
Optimized SDK initialization and reduced memory footprint
Breaking Changes
1. SDK Initialization
v2:2. Customer Registration
v2:3. Event Tracking
v2:4. Method Name Changes
| v2 | v3.0.0 |
|---|---|
Gameball.configure() | Gameball.shared.initialize(with:) |
Gameball.registerPlayer() | Gameball.shared.initializeCustomer(with:) |
Gameball.sendEvent() | Gameball.shared.sendEvent(_:completion:) |
Gameball.sendOrder() | Gameball.shared.sendOrder(_:completion:) |
PlayerAttributes | CustomerAttributes |
PlayerRegisterResponse | InitializeCustomerResponse |
5. Show Profile Widget
v2:6. Error Handling
v2:7. Session Token Authentication (New in v3.1.0)
Session tokens enable automatic v4.1 endpoint routing and enhanced security. The token is stored in memory with thread-safe access.
8. Async/Await Support (New in v3.0.0)
Migration Steps
From v3.0.0 to v3.1.0 (No Breaking Changes)
v3.1.0 is fully backward compatible. Simply update the dependency version. Session Token support is optional.
1
Update Dependency
Update your SPM:
Update to version
Podfile or Swift Package Manager configuration to use SDK v3.1.0: CocoaPods:Update to version
3.1.0 in Xcode package dependencies.2
(Optional) Add Session Token
If you need enhanced security, add a session token to your configuration:
3
Test
Test your integration. All existing v3.0.0 code should work without changes.
From v2.x to v3.1.0
1
Update Dependency
Update your SPM:
Update to version
Podfile or Swift Package Manager configuration to use SDK v3.1.0: CocoaPods:Update to version
3.1.0 in Xcode package dependencies.2
Update Initialization
Replace
Gameball.configure() with the new GameballConfig and initialize(with:) pattern.3
Update Customer Registration
Replace
registerPlayer() with initializeCustomer() using the new request type InitializeCustomerRequest.4
Update Event Tracking
Update event creation to use the new
GameballEvent API with the addEvent() method.5
Update Error Handling
Replace boolean success handlers with Result-based completion handlers to access detailed error information.
6
Update Show Profile
Use the new
ShowProfileRequest for displaying the profile widget.7
Test Thoroughly
Test all Gameball functionality (registration, events, orders, profile, etc.) to ensure the migration is successful.
Compatibility
- Minimum iOS: iOS 13.0+
- Xcode: 14.0+
- Swift: 5.7+
- CocoaPods: 1.11+
Additional Resources
- See the:
- [SDK](https://github.com/gameballers/gameball-ios/blob/release-3.1.0/CHANGELOG.md)
- [CHANGELOG.md for detailed version history
- Review:
- [MIGRATION.md](http://MIGRATION.md) in the repository for additional migration guidance
- View:
- [RELEASE_](https://github.com/gameballers/gameball-ios/blob/release-3.1.0/RELEASE_NOTES.md)
- [NOTES.md](http://NOTES.md) for v3.1.0 release details
- Visit:
- [Gameball Developer Docs](https://developer.gameball.co) for the latest documentation