Skip to content

Commit

Permalink
fix: stop session replay when plugin/middleware is shut down (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
crleona authored Oct 2, 2024
1 parent ad15109 commit b7f0775
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/amplitude/Amplitude-iOS.git",
"state" : {
"revision" : "681c49824a2b011256f3e66ab910f2e514629bd3",
"version" : "8.21.0"
"revision" : "4471ff73fffdff9a9b256422a0a0b9233582f33d",
"version" : "8.22.0"
}
},
{
"identity" : "amplitude-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/amplitude/Amplitude-Swift.git",
"state" : {
"revision" : "ce41c105bf9f0a1518f8bd6e594177c69512f054",
"version" : "1.9.2"
"revision" : "3ac8de1f8fed85fb9907b34579c1500c218dfedb",
"version" : "1.9.3"
}
},
{
Expand All @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/analytics-swift",
"state" : {
"revision" : "f6f3a7fafcace7bcdbda329f9b309f31bf9a42a1",
"version" : "1.5.11"
"revision" : "41df3103293bbed6f17489fcc28e16a6e495168d",
"version" : "1.6.1"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/amplitude/Amplitude-Swift.git", from: "1.9.2"),
.package(url: "https://github.com/amplitude/Amplitude-iOS.git", from: "8.21.0"),
.package(url: "https://github.com/amplitude/Amplitude-iOS.git", from: "8.22.0"),
.package(url: "https://github.com/segmentio/analytics-swift", "1.5.0"..<"2.0.0"),
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@ public class AmplitudeSegmentSessionReplayPlugin: Plugin {

return event
}

public func shutdown() {
sessionReplay.stop()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,8 @@ import AmplitudeSessionReplay
sessionReplay?.flush()
}
}

public func amplitudeDidRemove(_ amplitude: Amplitude) {
sessionReplay?.stop()
}
}

0 comments on commit b7f0775

Please sign in to comment.