Skip to main content
This guide walks you through migrating from Gameball iOS SDK v2 to v3.2.2.

What’s New in v3.2.2

Widget Events, Dismissal & External Links — v3.2.x keeps all v3.x code compatible. Every new capability is opt-in, so an existing integration keeps working after a version bump.

Highlights in v3.2.2

  • RTL Layout No Longer Leaks: the widget’s right-to-left layout direction is scoped to the widget’s own view. Opening the widget in Arabic no longer flips your app’s layout.

Highlights in v3.2.1

  • Vector Close Button: the close “X” is drawn as a vector tinted by closeButtonColor (default #CECECE), so it stays crisp at any screen scale.
  • Smaller SDK Footprint: 70 unused bundled images were removed. No public API or behavior change.

Highlights in v3.2.0

  • Widget Event Channel: widgetEventCallback on ShowProfileRequest receives events posted from the widget, such as gameCompleted.
  • Host-Initiated Dismiss: GameballApp.getInstance().hideProfile() dismisses the widget programmatically.
  • Web-Initiated Close: the widget can dismiss itself via window.GameballWidget.closeWidget().
  • External-Link Handling: links tagged gbExternalBrowser=true open in the system browser, or in your own handler via externalLinkCallback.
  • Channel Merging: ShowProfileRequest accepts optional mobile and email.
  • Diagnostic Logging: the SDK records internal diagnostic logs to aid troubleshooting. No integration changes required.

Migrate v3.1.x → v3.2.2 (Non-Breaking)

  • Update the SPM dependency to from: "3.2.2".
  • No code changes are required. Adopt the new widget capabilities only if you need them — see Show Profile Widget.

Highlights in v3.1.1

  • Guest Mode Fix: Profile widget works without a customer ID.
  • Non-Throwing ShowProfileRequest: Remove the try keyword when creating the request.
  • Optional customerId: Omit for guest experiences.
  • Session Tokens: Still supported for secure routing to v4.1.

Migrate v3.1.0 → v3.1.1 (Non-Breaking)

  • Update SPM dependency to from: "3.1.1".
  • Drop try when creating ShowProfileRequest (initializer is non-throwing).
  • Use guest mode when customerId is not available:
  • Authenticated mode stays the same:

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:
v3.2.2:

2. Customer Registration

v2:
v3.2.2:

3. Event Tracking

v2:
v3.2.2:

4. Method Name Changes


5. Show Profile Widget

v2:
v3.2.2:

6. Error Handling

v2:
v3.2.2:

7. Session Token Authentication (New in v3.1.x)

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.x to v3.2.2 (No Breaking Changes)

v3.2.x is fully backward compatible with earlier v3 releases. Simply update the dependency version. Session Token support and the new widget capabilities are optional.
1

Update Dependency

Update your Swift Package Manager dependency to 3.2.2.
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.2.2

1

Update Dependency

Update your Swift Package Manager dependency to 3.2.2.
2

Update Initialization

Replace the Gameball(apiKey:…) initializer with GameballConfig + GameballApp.getInstance().init(config:).
3

Update Customer Registration

Replace registerPlayer() with initializeCustomer() using the new request type InitializeCustomerRequest.
4

Update Event Tracking

Update event creation to use the Event model and pass it to sendEvent.
5

Update Error Handling

Replace boolean success handlers with Result-based completion handlers to access detailed error information.
6

Update Show Profile

Use the non-throwing ShowProfileRequest (guest mode optional) for displaying the profile widget.
7

Test Thoroughly

Test all Gameball functionality (registration, events, profile, notifications, etc.) to ensure the migration is successful.

Compatibility

  • Minimum iOS: iOS 12.0+
  • Xcode: 12.0+
  • Swift: 5.0+

Additional Resources

If you encounter issues during migration, check the GitHub repository for known issues and solutions, or contact Gameball support.