Learn about the breaking changes introduced in the iOS (Swift) SDK.
This document outlines the breaking changes introduced in the iOS (Swift) SDK when migrating from the legacy iOS (Obj-C) SDKiOS (Obj-C) refers to the legacy RudderStack iOS SDK. Note that it will be deprecated soon.
For new implementations, use the iOS (Swift) SDK instead.
.
The iOS (Swift) SDK is built from scratch while retaining the core functionalities of the iOS (Obj-C) SDKiOS (Obj-C) refers to the legacy RudderStack iOS SDK. Note that it will be deprecated soon.
For new implementations, use the iOS (Swift) SDK instead.
.
The way of initializing the iOS (Swift) SDK has changed. See the following snippets for comparison:
In the iOS (Obj-C) SDK, an RSOption instance was created using method chaining:
let option = RSOption()
.putIntegration("Amplitude", isEnabled: false)
.putExternalId("brazeExternalId", withId: "some_external_id_1")
.putCustomContext(["key": "value"], withKey: "customKey")
let traits = ["name": "John", "email": "john@example.com"]
RSClient.sharedInstance()?.identify("user123", traits: traits, options: option)
In the iOS (Swift) SDK, a RudderOption instance is created using constructor arguments:
let externalId = ExternalId(type: "brazeExternalId", id: "some_external_id_1")
let option = RudderOption(
integrations: ["Amplitude": false],
customContext: ["customKey": ["key": "value"]],
externalIds: [externalId]
)
let traits = ["name": "John", "email": "john@example.com"]
// Identify event is used just for demonstration purposes.
analytics.identify(userId: "user123", traits: traits, options: option)
The following table maps the SDK configuration options available in the iOS (Obj-C) SDK to the new iOS (Swift) SDK:
This section covers the different feature updates introduced in the iOS (Swift) SDK: