Skip to content

Commit 40c6635

Browse files
Update plugin for breaking change in analytics-swift 1.9.1 (#32)
* Update analytics-swift to 1.9.1 This version introduces a breaking change in the JSON.setValue API. * Update JSON.setValue call sites
1 parent ac05173 commit 40c6635

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let package = Package(
1919
dependencies: [
2020
// Dependencies declare other packages that this package depends on.
2121
// .package(url: /* package url */, from: "1.0.0"),
22-
.package(url: "https://github.com/segmentio/analytics-swift.git", from: "1.6.0")
22+
.package(url: "https://github.com/segmentio/analytics-swift.git", from: "1.9.1")
2323
],
2424
targets: [
2525
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Sources/SegmentAmplitude/AmplitudeSession.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public class AmplitudeSession: EventPlugin, iOSLifecycle {
107107
if adjustedProps == nil {
108108
adjustedProps = try? JSON(["name": screenName])
109109
} else {
110-
adjustedProps?.setValue(screenName, forKeyPath: KeyPath("name"))
110+
adjustedProps?.setValue(screenName, forKeyPath: JSONKeyPath("name"))
111111
}
112112
screenEvent.properties = adjustedProps
113113
workingEvent = screenEvent as? T
@@ -132,7 +132,7 @@ public class AmplitudeSession: EventPlugin, iOSLifecycle {
132132
// if it's amp specific stuff, disable all the integrations except for amp.
133133
if eventName.contains(Constants.ampPrefix) || eventName == Constants.ampSessionStartEvent || eventName == Constants.ampSessionEndEvent {
134134
var integrations = disableAllIntegrations(integrations: trackEvent.integrations)
135-
integrations?.setValue(["session_id": eventSessionID], forKeyPath: KeyPath(key))
135+
integrations?.setValue(["session_id": eventSessionID], forKeyPath: JSONKeyPath(key))
136136
trackEvent.integrations = integrations
137137
}
138138

@@ -186,7 +186,7 @@ extension AmplitudeSession {
186186
var result = integrations
187187
if let keys = integrations?.dictionaryValue?.keys {
188188
for key in keys {
189-
result?.setValue(false, forKeyPath: KeyPath(key))
189+
result?.setValue(false, forKeyPath: JSONKeyPath(key))
190190
}
191191
}
192192
return result

0 commit comments

Comments
 (0)