From 0920b749dbd82d451cae27733cb39f2144a4794e Mon Sep 17 00:00:00 2001 From: Ajay Subramanya <118314354+ajaysubra@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:04:44 -0500 Subject: [PATCH 1/8] 4.0.0 release branch --- KlaviyoCore.podspec | 2 +- KlaviyoSwift.podspec | 4 ++-- KlaviyoSwiftExtension.podspec | 2 +- Sources/KlaviyoCore/Utils/Version.swift | 2 +- .../__Snapshots__/EncodableTests/testEventPayload.1.json | 2 +- .../__Snapshots__/EncodableTests/testKlaviyoRequest.1.json | 2 +- .../__Snapshots__/EncodableTests/testTokenPayload.1.json | 2 +- .../testCreateEmphemeralSesionHeaders.1.txt | 2 +- .../NetworkSessionTests/testDefaultUserAgent.1.txt | 2 +- .../__Snapshots__/EncodableTests/testKlaviyoState.1.json | 4 ++-- .../KlaviyoStateTests/testValidStateFileExists.1.txt | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/KlaviyoCore.podspec b/KlaviyoCore.podspec index 1110fc46..b02cc958 100644 --- a/KlaviyoCore.podspec +++ b/KlaviyoCore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KlaviyoCore" - s.version = "0.1.0" + s.version = "1.0.0" s.summary = "Core functionalities for the Klaviyo SDK" s.description = <<-DESC Core functionalities and utilities for the Klaviyo SDK. diff --git a/KlaviyoSwift.podspec b/KlaviyoSwift.podspec index f07adbeb..69d8ce4c 100644 --- a/KlaviyoSwift.podspec +++ b/KlaviyoSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KlaviyoSwift" - s.version = "3.2.0" + s.version = "4.0.0" s.summary = "Incorporate Klaviyo's event and person tracking and push notifications functionality into iOS applications" s.description = <<-DESC @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' s.source_files = 'Sources/KlaviyoSwift/**/*.swift' s.resource_bundles = {"KlaviyoSwift" => ["Sources/KlaviyoSwift/PrivacyInfo.xcprivacy"]} - s.dependency 'KlaviyoCore', '~> 0.1.0' + s.dependency 'KlaviyoCore', '~> 1.0.0' s.dependency 'AnyCodable-FlightSchool' end diff --git a/KlaviyoSwiftExtension.podspec b/KlaviyoSwiftExtension.podspec index 5870629d..d7abda9d 100644 --- a/KlaviyoSwiftExtension.podspec +++ b/KlaviyoSwiftExtension.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KlaviyoSwiftExtension" - s.version = "3.2.0" + s.version = "4.0.0" s.summary = "Incorporate Klaviyo's rich push notifications functionality into your iOS applications" s.description = <<-DESC diff --git a/Sources/KlaviyoCore/Utils/Version.swift b/Sources/KlaviyoCore/Utils/Version.swift index 41a5ab26..25d8d8e5 100644 --- a/Sources/KlaviyoCore/Utils/Version.swift +++ b/Sources/KlaviyoCore/Utils/Version.swift @@ -8,4 +8,4 @@ import Foundation public let __klaviyoSwiftName = "swift" -public let __klaviyoSwiftVersion = "3.2.0" +public let __klaviyoSwiftVersion = "4.0.0" diff --git a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testEventPayload.1.json b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testEventPayload.1.json index 0fe6338e..b7b9dc63 100644 --- a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testEventPayload.1.json +++ b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testEventPayload.1.json @@ -36,7 +36,7 @@ "OS Version" : "1.1.1", "Push Token" : "", "SDK Name" : "swift", - "SDK Version" : "3.2.0", + "SDK Version" : "4.0.0", "stuff" : 2 }, "time" : "2009-02-13T23:31:30Z", diff --git a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testKlaviyoRequest.1.json b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testKlaviyoRequest.1.json index 4e9b45c7..c3676c86 100644 --- a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testKlaviyoRequest.1.json +++ b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testKlaviyoRequest.1.json @@ -18,7 +18,7 @@ "manufacturer" : "Orange", "os_name" : "iOS", "os_version" : "1.1.1", - "sdk_version" : "3.2.0" + "sdk_version" : "4.0.0" }, "enablement_status" : "AUTHORIZED", "platform" : "ios", diff --git a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testTokenPayload.1.json b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testTokenPayload.1.json index 8935058a..e7705815 100644 --- a/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testTokenPayload.1.json +++ b/Tests/KlaviyoCoreTests/__Snapshots__/EncodableTests/testTokenPayload.1.json @@ -14,7 +14,7 @@ "manufacturer" : "Orange", "os_name" : "iOS", "os_version" : "1.1.1", - "sdk_version" : "3.2.0" + "sdk_version" : "4.0.0" }, "enablement_status" : "AUTHORIZED", "platform" : "ios", diff --git a/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testCreateEmphemeralSesionHeaders.1.txt b/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testCreateEmphemeralSesionHeaders.1.txt index 19cd06cb..2e074992 100644 --- a/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testCreateEmphemeralSesionHeaders.1.txt +++ b/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testCreateEmphemeralSesionHeaders.1.txt @@ -8,7 +8,7 @@ - "deflate" ▿ (2 elements) - key: "User-Agent" - - value: "FooApp/1.2.3 (com.klaviyo.fooapp; build:1; iOS 1.1.1) klaviyo-ios/3.2.0" + - value: "FooApp/1.2.3 (com.klaviyo.fooapp; build:1; iOS 1.1.1) klaviyo-ios/4.0.0" ▿ (2 elements) - key: "X-Klaviyo-Mobile" - value: "1" diff --git a/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testDefaultUserAgent.1.txt b/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testDefaultUserAgent.1.txt index 40374900..24403918 100644 --- a/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testDefaultUserAgent.1.txt +++ b/Tests/KlaviyoCoreTests/__Snapshots__/NetworkSessionTests/testDefaultUserAgent.1.txt @@ -1 +1 @@ -- "FooApp/1.2.3 (com.klaviyo.fooapp; build:1; iOS 1.1.1) klaviyo-ios/3.2.0" +- "FooApp/1.2.3 (com.klaviyo.fooapp; build:1; iOS 1.1.1) klaviyo-ios/4.0.0" diff --git a/Tests/KlaviyoSwiftTests/__Snapshots__/EncodableTests/testKlaviyoState.1.json b/Tests/KlaviyoSwiftTests/__Snapshots__/EncodableTests/testKlaviyoState.1.json index edb7e4c7..dd711ce9 100644 --- a/Tests/KlaviyoSwiftTests/__Snapshots__/EncodableTests/testKlaviyoState.1.json +++ b/Tests/KlaviyoSwiftTests/__Snapshots__/EncodableTests/testKlaviyoState.1.json @@ -15,7 +15,7 @@ "manufacturer" : "Orange", "os_name" : "iOS", "os_version" : "1.1.1", - "sdk_version" : "3.2.0" + "sdk_version" : "4.0.0" }, "pushBackground" : "AVAILABLE", "pushEnablement" : "AUTHORIZED", @@ -42,7 +42,7 @@ "manufacturer" : "Orange", "os_name" : "iOS", "os_version" : "1.1.1", - "sdk_version" : "3.2.0" + "sdk_version" : "4.0.0" }, "enablement_status" : "AUTHORIZED", "platform" : "ios", diff --git a/Tests/KlaviyoSwiftTests/__Snapshots__/KlaviyoStateTests/testValidStateFileExists.1.txt b/Tests/KlaviyoSwiftTests/__Snapshots__/KlaviyoStateTests/testValidStateFileExists.1.txt index 751eaaf8..507d0eba 100644 --- a/Tests/KlaviyoSwiftTests/__Snapshots__/KlaviyoStateTests/testValidStateFileExists.1.txt +++ b/Tests/KlaviyoSwiftTests/__Snapshots__/KlaviyoStateTests/testValidStateFileExists.1.txt @@ -28,7 +28,7 @@ - manufacturer: "Orange" - osName: "iOS" - osVersion: "1.1.1" - - sdkVersion: "3.2.0" + - sdkVersion: "4.0.0" - pushBackground: PushBackground.available - pushEnablement: PushEnablement.authorized - pushToken: "blob_token" From 52a7c3f0bed9a500fd3340aabf9d2c55cbce50d2 Mon Sep 17 00:00:00 2001 From: Andrew Balmer Date: Wed, 25 Sep 2024 15:08:17 -0400 Subject: [PATCH 2/8] Update MIGRATION_GUIDE.md --- MIGRATION_GUIDE.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 9ffa83cf..bd84cdb7 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -3,6 +3,41 @@ This guide outlines how developers can migrate from older versions of our SDK to newer ones. +## Migrating to v4.0.0 + +### `Event.EventName` enum: + +- We have removed the PascalCase names in the `Event.EventName` enum, leaving only the camelCase names. You will need to remove any references to the old PascalCase names. +- We have removed the `.OpenedPush` case (there is no camelCase replacement), as this is intended for internal use only. You will need to remove any references to the `.OpenedPush` case. + +## Migrating to v3.3.0 + +We've updated the case names in the `Event.EventName` enum from PascalCase to camelCase, to be consistent with [Swift naming conventions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/enumerations/). +The old case PascalCase names are currently still in place and have the same functionality as the new camelCase names, but will be removed in a future release. Any direct references to the old PascalCase names will now show a deprecation warning, along with an option to "fix" the name by replacing it with the camelCase version. + +This update is non-breaking for most use-cases, but any consumers who are `switch`ing over the `Event.EventName` enum will need to make minor changes. There are two scenarios: + +1. If the existing `switch` statement does not include a `default` case, the compiler will throw a "Switch must be exhaustive" error. You may click "Fix" to have Xcode automatically add the missing cases, but we recommend that you add the new camelCase names alongside the old ones in your branching logic. For example: + + ```swift + switch event { + case .OpenedPush: + <...> + case .OpenedAppMetric, .openedAppMetric: + <...> + case .ViewedProductMetric, .viewedProductMetric: + <...> + case .AddedToCartMetric, .addedToCartMetric: + <...> + case .StartedCheckoutMetric, .startedCheckoutMetric: + <...> + case .CustomEvent(let string), .customEvent(let string): + <...> + } + ``` + +2. If the existing `switch` statement does include a `default` case, any logic touching the new camelCase names will be branched into the `default` case unless the `switch` statement is updated. We recommend updating the `switch` statement as described in (1) above to address this situation. + ## Migrating to v3.3.0 We've updated the case names in the `Event.EventName` enum from PascalCase to camelCase, to be consistent with [Swift naming conventions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/enumerations/). From 531dd523911a9134af3243eac1369756197cef84 Mon Sep 17 00:00:00 2001 From: Andrew Balmer Date: Wed, 25 Sep 2024 15:12:31 -0400 Subject: [PATCH 3/8] added link to 3.3.0 notes --- MIGRATION_GUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index bd84cdb7..072f4a5a 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -7,7 +7,7 @@ This guide outlines how developers can migrate from older versions of our SDK to ### `Event.EventName` enum: -- We have removed the PascalCase names in the `Event.EventName` enum, leaving only the camelCase names. You will need to remove any references to the old PascalCase names. +- We have removed the PascalCase names in the `Event.EventName` enum, leaving only the camelCase names. You will need to remove any references to the old PascalCase names. See [Migrating to v3.3.0](https://github.com/klaviyo/klaviyo-swift-sdk/blob/as/rel-400/MIGRATION_GUIDE.md#migrating-to-v330) below for more details. - We have removed the `.OpenedPush` case (there is no camelCase replacement), as this is intended for internal use only. You will need to remove any references to the `.OpenedPush` case. ## Migrating to v3.3.0 From bf414958dae139e0f9423ab573d6e43acb688446 Mon Sep 17 00:00:00 2001 From: Andrew Balmer Date: Wed, 25 Sep 2024 15:13:15 -0400 Subject: [PATCH 4/8] removed duplicate 3.3.0 notes --- MIGRATION_GUIDE.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 072f4a5a..630429a1 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -38,34 +38,6 @@ This update is non-breaking for most use-cases, but any consumers who are `switc 2. If the existing `switch` statement does include a `default` case, any logic touching the new camelCase names will be branched into the `default` case unless the `switch` statement is updated. We recommend updating the `switch` statement as described in (1) above to address this situation. -## Migrating to v3.3.0 - -We've updated the case names in the `Event.EventName` enum from PascalCase to camelCase, to be consistent with [Swift naming conventions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/enumerations/). -The old case PascalCase names are currently still in place and have the same functionality as the new camelCase names, but will be removed in a future release. Any direct references to the old PascalCase names will now show a deprecation warning, along with an option to "fix" the name by replacing it with the camelCase version. - -This update is non-breaking for most use-cases, but any consumers who are `switch`ing over the `Event.EventName` enum will need to make minor changes. There are two scenarios: - -1. If the existing `switch` statement does not include a `default` case, the compiler will throw a "Switch must be exhaustive" error. You may click "Fix" to have Xcode automatically add the missing cases, but we recommend that you add the new camelCase names alongside the old ones in your branching logic. For example: - - ```swift - switch event { - case .OpenedPush: - <...> - case .OpenedAppMetric, .openedAppMetric: - <...> - case .ViewedProductMetric, .viewedProductMetric: - <...> - case .AddedToCartMetric, .addedToCartMetric: - <...> - case .StartedCheckoutMetric, .startedCheckoutMetric: - <...> - case .CustomEvent(let string), .customEvent(let string): - <...> - } - ``` - -2. If the existing `switch` statement does include a `default` case, any logic touching the new camelCase names will be branched into the `default` case unless the `switch` statement is updated. We recommend updating the `switch` statement as described in (1) above to address this situation. - ## Migrating to v3.0.0 Deprecated event type enum cases have been removed. From 1fd9cdabe24d8f5a4d83b3889b316efa7031c4a1 Mon Sep 17 00:00:00 2001 From: Ajay Subramanya <118314354+ajaysubra@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:14:59 -0500 Subject: [PATCH 5/8] updated the pod spec of core --- KlaviyoCore.podspec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/KlaviyoCore.podspec b/KlaviyoCore.podspec index b02cc958..28f78ffe 100644 --- a/KlaviyoCore.podspec +++ b/KlaviyoCore.podspec @@ -8,8 +8,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/klaviyo/klaviyo-swift-sdk" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Mobile @ Klaviyo" => "mobile@klaviyo.com" } - # TODO: update the branch to a tag once created - s.source = { :git => "https://github.com/klaviyo/klaviyo-swift-sdk.git", :branch => 'master' } + s.source = { :git => "https://github.com/klaviyo/klaviyo-swift-sdk.git", :tag => s.version.to_s } s.swift_version = '5.7' s.platform = :ios, '13.0' s.source_files = 'Sources/KlaviyoCore/**/*.swift' From cdc1514b6cf47ea55177b0a195069430f2fc907f Mon Sep 17 00:00:00 2001 From: Ajay Subramanya <118314354+ajaysubra@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:29:14 -0500 Subject: [PATCH 6/8] using branch master instead of tag --- KlaviyoCore.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KlaviyoCore.podspec b/KlaviyoCore.podspec index 28f78ffe..10bce643 100644 --- a/KlaviyoCore.podspec +++ b/KlaviyoCore.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/klaviyo/klaviyo-swift-sdk" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Mobile @ Klaviyo" => "mobile@klaviyo.com" } - s.source = { :git => "https://github.com/klaviyo/klaviyo-swift-sdk.git", :tag => s.version.to_s } + s.source = { :git => "https://github.com/klaviyo/klaviyo-swift-sdk.git", :branch => 'master' } s.swift_version = '5.7' s.platform = :ios, '13.0' s.source_files = 'Sources/KlaviyoCore/**/*.swift' From 147af5da5ece7d3c58b75dc2259eef9aa4e3588a Mon Sep 17 00:00:00 2001 From: Ajay Subramanya <118314354+ajaysubra@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:46:30 -0500 Subject: [PATCH 7/8] using klaviyo core initial published version --- KlaviyoCore.podspec | 2 +- KlaviyoSwift.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/KlaviyoCore.podspec b/KlaviyoCore.podspec index 10bce643..dd10aa59 100644 --- a/KlaviyoCore.podspec +++ b/KlaviyoCore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "KlaviyoCore" - s.version = "1.0.0" + s.version = "0.1.0" s.summary = "Core functionalities for the Klaviyo SDK" s.description = <<-DESC Core functionalities and utilities for the Klaviyo SDK. diff --git a/KlaviyoSwift.podspec b/KlaviyoSwift.podspec index 69d8ce4c..026c9a96 100644 --- a/KlaviyoSwift.podspec +++ b/KlaviyoSwift.podspec @@ -16,6 +16,6 @@ Pod::Spec.new do |s| s.ios.deployment_target = '13.0' s.source_files = 'Sources/KlaviyoSwift/**/*.swift' s.resource_bundles = {"KlaviyoSwift" => ["Sources/KlaviyoSwift/PrivacyInfo.xcprivacy"]} - s.dependency 'KlaviyoCore', '~> 1.0.0' + s.dependency 'KlaviyoCore', '~> 0.1.0' s.dependency 'AnyCodable-FlightSchool' end From 1bc691e956b4dfda9b288af277ccf80966f88da8 Mon Sep 17 00:00:00 2001 From: Ajay Subramanya <118314354+ajaysubra@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:09:07 -0500 Subject: [PATCH 8/8] added a comment --- KlaviyoCore.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/KlaviyoCore.podspec b/KlaviyoCore.podspec index dd10aa59..1110fc46 100644 --- a/KlaviyoCore.podspec +++ b/KlaviyoCore.podspec @@ -8,6 +8,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/klaviyo/klaviyo-swift-sdk" s.license = { :type => "MIT", :file => "LICENSE" } s.author = { "Mobile @ Klaviyo" => "mobile@klaviyo.com" } + # TODO: update the branch to a tag once created s.source = { :git => "https://github.com/klaviyo/klaviyo-swift-sdk.git", :branch => 'master' } s.swift_version = '5.7' s.platform = :ios, '13.0'