Skip to content

Commit

Permalink
[MOBILE-11948] Release 0.7.1 with Live data feed identity (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnickel authored Aug 28, 2024
1 parent cc303a3 commit 79bac91
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## [0.7.1]

### Added

- The SDK now sends identity to the Live data feed.

## [0.7.0]

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

[Unreleased]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.0...main
[Unreleased]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.1...main
[0.7.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.7.0...0.7.1
[0.7.0]: https://github.com/heap/heap-swift-core-sdk/compare/0.6.1...0.7.0
[0.6.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/heap/heap-swift-core-sdk/compare/0.5.3...0.6.0
Expand All @@ -208,4 +215,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[0.1.2]: https://github.com/heap/heap-swift-core-sdk/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/heap/heap-swift-core-sdk/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/heap/heap-swift-core-sdk/releases/tag/0.1.0
[user privacy and data use]: https://developer.apple.com/app-store/user-privacy-and-data-use/
[user privacy and data use]: https://developer.apple.com/app-store/user-privacy-and-data-use/
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extension NotificationInteractionSource {
case .geofence: return .sourceGeofence
case .interval: return .sourceTimeInterval
case .calendar: return .sourceCalendar
@unknown default: return .sourceUnknown
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ extension Message {
envID = state.environment.envID
userID = state.environment.userID

if state.environment.hasIdentity {
identity = state.environment.identity
}

baseLibrary = state.sdkInfo.libraryInfo
application = state.sdkInfo.applicationInfo
device = state.sdkInfo.deviceInfo
Expand Down
2 changes: 1 addition & 1 deletion Development/Sources/HeapSwiftCore/Version.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct Version {
static let minor = 7

/// Revision number.
static let revision = 0
static let revision = 1

/// Optional pre-release version
static let prerelease: String? = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ final class EventConsumer_IdentifySpec: HeapSpec {
let state = dataStore.loadState(for: "11")
expect(state.properties).to(equal(originalState.properties))
}

it("causes identity to be sent in subsequent messages") {
consumer.track("event")
let user = try dataStore.assertUserToUploadExists(with: consumer.userId!)
let messages = try dataStore.getPendingMessages(for: user, sessionId: consumer.activeOrExpiredSessionId)

expect(messages).toNot(beEmpty())
for message in messages {
expect(message.identity).to(equal("user1"))
}
}
}

context("called with a valid identity, before the session expires") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,17 @@ final class EventConsumer_ResetIdentitySpec: HeapSpec {

it("extends the session") {
try consumer.assertSessionWasExtended(from: resetTimestamp)
}
}

it("causes identity to not be sent in subsequent messages") {
let user = try dataStore.assertUserToUploadExists(with: consumer.userId!)
let messages = try dataStore.getPendingMessages(for: user, sessionId: consumer.activeOrExpiredSessionId)

expect(messages).toNot(beEmpty())
for message in messages {
expect(message.identity).to(beEmpty())
}
}
}

context("Heap is recording with clearEventPropertiesOnNewUser set as true") {
Expand Down
2 changes: 1 addition & 1 deletion HeapSwiftCore.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'HeapSwiftCore'
s.version = '0.7.0'
s.version = '0.7.1'
s.license = { :type => 'MIT' }
s.summary = 'The core Heap library used for apps on Apple platforms.'
s.homepage = 'https://heap.io'
Expand Down

0 comments on commit 79bac91

Please sign in to comment.