Skip to content

Commit

Permalink
Updated Session / App Lifecycle logic (#21)
Browse files Browse the repository at this point in the history
* Amplitude sdk integration

* Session rewrite

* Bug fixes

* Block application foregrounded event.

* Made disabling of integrations correct.

* Fixed duplicated amp start/end session events.

* Relocate sessionID set'ing.

* Reset session ID after 5 mins of inactivity, even in app.

* Updates

* Updated privacy manifest to match amplitude.

* Updated package resolution

* Updated package resolution.

* Updated CI info
  • Loading branch information
bsneed authored May 1, 2024
1 parent ac094be commit ef0335f
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:

build_and_test_examples:
needs: cancel_previous
runs-on: macos-11
runs-on: macos-14
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.0'
xcode-version: '15.2'
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"object": {
"pins": [
{
"package": "Segment",
"repositoryURL": "https://github.com/segmentio/analytics-swift",
"state": {
"branch": null,
"revision": "7eeb2abf8452153af056baae5369679589f10936",
"version": "1.5.9"
}
},
{
"package": "JSONSafeEncoder",
"repositoryURL": "https://github.com/segmentio/jsonsafeencoder-swift.git",
"state": {
"branch": null,
"revision": "8b70dc8c01b7b041912e30e29d2b488a43f782ac",
"version": "1.0.1"
}
},
{
"package": "Sovran",
"repositoryURL": "https://github.com/segmentio/Sovran-Swift.git",
"state": {
"branch": null,
"revision": "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version": "1.1.1"
}
"pins" : [
{
"identity" : "analytics-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/analytics-swift",
"state" : {
"revision" : "7eeb2abf8452153af056baae5369679589f10936",
"version" : "1.5.9"
}
]
},
"version": 1
},
{
"identity" : "jsonsafeencoder-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/jsonsafeencoder-swift.git",
"state" : {
"revision" : "8b70dc8c01b7b041912e30e29d2b488a43f782ac",
"version" : "1.0.1"
}
},
{
"identity" : "sovran-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/Sovran-Swift.git",
"state" : {
"revision" : "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version" : "1.1.1"
}
}
],
"version" : 2
}
60 changes: 29 additions & 31 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"object": {
"pins": [
{
"package": "Segment",
"repositoryURL": "https://github.com/segmentio/analytics-swift.git",
"state": {
"branch": null,
"revision": "7eeb2abf8452153af056baae5369679589f10936",
"version": "1.5.9"
}
},
{
"package": "JSONSafeEncoder",
"repositoryURL": "https://github.com/segmentio/jsonsafeencoder-swift.git",
"state": {
"branch": null,
"revision": "8b70dc8c01b7b041912e30e29d2b488a43f782ac",
"version": "1.0.1"
}
},
{
"package": "Sovran",
"repositoryURL": "https://github.com/segmentio/Sovran-Swift.git",
"state": {
"branch": null,
"revision": "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version": "1.1.1"
}
"pins" : [
{
"identity" : "analytics-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/analytics-swift.git",
"state" : {
"revision" : "7eeb2abf8452153af056baae5369679589f10936",
"version" : "1.5.9"
}
]
},
"version": 1
},
{
"identity" : "jsonsafeencoder-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/jsonsafeencoder-swift.git",
"state" : {
"revision" : "8b70dc8c01b7b041912e30e29d2b488a43f782ac",
"version" : "1.0.1"
}
},
{
"identity" : "sovran-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/Sovran-Swift.git",
"state" : {
"revision" : "a342b905f6baa64499cabdf61ccc185ec476b7b2",
"version" : "1.1.1"
}
}
],
"version" : 2
}
15 changes: 7 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -19,19 +19,18 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(
name: "Segment",
url: "https://github.com/segmentio/analytics-swift.git",
from: "1.5.9"
)
.package(url: "https://github.com/segmentio/analytics-swift.git", from: "1.5.9")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "SegmentAmplitude",
dependencies: ["Segment"]),

dependencies: [
.product(name: "Segment", package: "analytics-swift")
],
resources: [.process("Resources")]
)
// TESTS ARE HANDLED VIA THE EXAMPLE APP.
]
)
Expand Down
Loading

0 comments on commit ef0335f

Please sign in to comment.