Skip to content

Commit 79bac91

Browse files
authored
[MOBILE-11948] Release 0.7.1 with Live data feed identity (#165)
1 parent cc303a3 commit 79bac91

File tree

7 files changed

+38
-5
lines changed

7 files changed

+38
-5
lines changed

CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
1414
## [Unreleased]
1515

16+
## [0.7.1]
17+
18+
### Added
19+
20+
- The SDK now sends identity to the Live data feed.
21+
1622
## [0.7.0]
1723

1824
### Added
@@ -192,7 +198,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
192198
- Support for manual capture within WKWebView.
193199
- Support for platforms targeting Swift: macOS, watchOS, iOS, iPadOS, tvOS.
194200

195-
[Unreleased]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.0...main
201+
[Unreleased]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.1...main
202+
[0.7.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.0...0.7.1
196203
[0.7.0]: https://github.com/heap/heap-swift-core-sdk/compare/0.6.1...0.7.0
197204
[0.6.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.6.0...0.6.1
198205
[0.6.0]: https://github.com/heap/heap-swift-core-sdk/compare/0.5.3...0.6.0
@@ -208,4 +215,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
208215
[0.1.2]: https://github.com/heap/heap-swift-core-sdk/compare/0.1.1...0.1.2
209216
[0.1.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.1.0...0.1.1
210217
[0.1.0]: https://github.com/heap/heap-swift-core-sdk/releases/tag/0.1.0
211-
[user privacy and data use]: https://developer.apple.com/app-store/user-privacy-and-data-use/
218+
[user privacy and data use]: https://developer.apple.com/app-store/user-privacy-and-data-use/

Development/Sources/HeapSwiftCore/Implementations/EventConsumer/NotificationInteractionSource.swift

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ extension NotificationInteractionSource {
88
case .geofence: return .sourceGeofence
99
case .interval: return .sourceTimeInterval
1010
case .calendar: return .sourceCalendar
11+
@unknown default: return .sourceUnknown
1112
}
1213
}
1314
}

Development/Sources/HeapSwiftCore/Protobufs/Extensions/Message.swift

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ extension Message {
88
envID = state.environment.envID
99
userID = state.environment.userID
1010

11+
if state.environment.hasIdentity {
12+
identity = state.environment.identity
13+
}
14+
1115
baseLibrary = state.sdkInfo.libraryInfo
1216
application = state.sdkInfo.applicationInfo
1317
device = state.sdkInfo.deviceInfo

Development/Sources/HeapSwiftCore/Version.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct Version {
88
static let minor = 7
99

1010
/// Revision number.
11-
static let revision = 0
11+
static let revision = 1
1212

1313
/// Optional pre-release version
1414
static let prerelease: String? = nil

Development/Tests/HeapSwiftCoreTests/EventConsumer/IdentifySpec.swift

+11
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,17 @@ final class EventConsumer_IdentifySpec: HeapSpec {
104104
let state = dataStore.loadState(for: "11")
105105
expect(state.properties).to(equal(originalState.properties))
106106
}
107+
108+
it("causes identity to be sent in subsequent messages") {
109+
consumer.track("event")
110+
let user = try dataStore.assertUserToUploadExists(with: consumer.userId!)
111+
let messages = try dataStore.getPendingMessages(for: user, sessionId: consumer.activeOrExpiredSessionId)
112+
113+
expect(messages).toNot(beEmpty())
114+
for message in messages {
115+
expect(message.identity).to(equal("user1"))
116+
}
117+
}
107118
}
108119

109120
context("called with a valid identity, before the session expires") {

Development/Tests/HeapSwiftCoreTests/EventConsumer/ResetIdentitySpec.swift

+11-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,17 @@ final class EventConsumer_ResetIdentitySpec: HeapSpec {
174174

175175
it("extends the session") {
176176
try consumer.assertSessionWasExtended(from: resetTimestamp)
177-
}
177+
}
178+
179+
it("causes identity to not be sent in subsequent messages") {
180+
let user = try dataStore.assertUserToUploadExists(with: consumer.userId!)
181+
let messages = try dataStore.getPendingMessages(for: user, sessionId: consumer.activeOrExpiredSessionId)
182+
183+
expect(messages).toNot(beEmpty())
184+
for message in messages {
185+
expect(message.identity).to(beEmpty())
186+
}
187+
}
178188
}
179189

180190
context("Heap is recording with clearEventPropertiesOnNewUser set as true") {

HeapSwiftCore.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'HeapSwiftCore'
3-
s.version = '0.7.0'
3+
s.version = '0.7.1'
44
s.license = { :type => 'MIT' }
55
s.summary = 'The core Heap library used for apps on Apple platforms.'
66
s.homepage = 'https://heap.io'

0 commit comments

Comments
 (0)