From f71d7acca9d8dc97925cb7146604f1d01e93b284 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Sat, 30 Mar 2024 03:56:10 +0500 Subject: [PATCH 01/11] updated target --- Package.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Package.swift b/Package.swift index aa355a83..d4d3f918 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( - name: "Segment", + name: "CDPAnalyticsSwift", platforms: [ .macOS("10.15"), .iOS("13.0"), @@ -15,8 +15,8 @@ let package = Package( products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( - name: "Segment", - targets: ["Segment"]), + name: "CDPAnalyticsSwift", + targets: ["CDPAnalyticsSwift"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -28,14 +28,14 @@ let package = Package( // 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: "Segment", + name: "CDPAnalyticsSwift", dependencies: [ .product(name: "Sovran", package: "sovran-swift"), .product(name: "JSONSafeEncoder", package: "jsonsafeencoder-swift") ], - resources: [.process("Resources")]), + resources: [.process("Segment/Resources")]), .testTarget( - name: "Segment-Tests", - dependencies: ["Segment"]), + name: "CDPAnalyticsSwift-Tests", + dependencies: ["CDPAnalyticsSwift"]), ] ) From 2cf9eade440f96ccf7fdfbdbb34a0756f9855b36 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Sat, 30 Mar 2024 04:44:08 +0500 Subject: [PATCH 02/11] fixed imports --- Sources/Segment/Plugins/SegmentDestination.swift | 4 ++-- Sources/Segment/Utilities/Storage/Storage.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Segment/Plugins/SegmentDestination.swift b/Sources/Segment/Plugins/SegmentDestination.swift index 91adce24..b22ec737 100644 --- a/Sources/Segment/Plugins/SegmentDestination.swift +++ b/Sources/Segment/Plugins/SegmentDestination.swift @@ -177,7 +177,7 @@ extension SegmentDestination { // we don't want to retry events in a given batch when a 400 // response for malformed JSON is returned - case .failure(Segment.HTTPClientErrors.statusCode(code: 400)): + case .failure(CDPAnalyticsSwift.HTTPClientErrors.statusCode(code: 400)): storage.remove(data: [url]) cleanupUploads() default: @@ -241,7 +241,7 @@ extension SegmentDestination { // we don't want to retry events in a given batch when a 400 // response for malformed JSON is returned - case .failure(Segment.HTTPClientErrors.statusCode(code: 400)): + case .failure(CDPAnalyticsSwift.HTTPClientErrors.statusCode(code: 400)): storage.remove(data: removable) cleanupUploads() default: diff --git a/Sources/Segment/Utilities/Storage/Storage.swift b/Sources/Segment/Utilities/Storage/Storage.swift index 12fd4d1d..cb675f07 100644 --- a/Sources/Segment/Utilities/Storage/Storage.swift +++ b/Sources/Segment/Utilities/Storage/Storage.swift @@ -24,7 +24,7 @@ internal class Storage: Subscriber { self.storageMode = storageMode self.userDefaults = UserDefaults(suiteName: "com.segment.storage.\(writeKey)")! - var storageURL = Segment.eventStorageDirectory(writeKey: writeKey) + var storageURL = CDPAnalyticsSwift.eventStorageDirectory(writeKey: writeKey) let asyncAppend = (operatingMode == .asynchronous) switch storageMode { case .diskAtURL(let url): From 9be796726bdec8e4e2f5b5cb875c2adb91b6d4e5 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Sat, 30 Mar 2024 05:02:04 +0500 Subject: [PATCH 03/11] making class open not sure how it got reverted? --- Sources/Segment/Plugins/SegmentDestination.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Segment/Plugins/SegmentDestination.swift b/Sources/Segment/Plugins/SegmentDestination.swift index b22ec737..a2c7ccea 100644 --- a/Sources/Segment/Plugins/SegmentDestination.swift +++ b/Sources/Segment/Plugins/SegmentDestination.swift @@ -16,9 +16,9 @@ import Sovran import FoundationNetworking #endif -public class SegmentDestination: DestinationPlugin, Subscriber, FlushCompletion { +open class SegmentDestination: DestinationPlugin, Subscriber, FlushCompletion { internal enum Constants: String { - case integrationName = "Segment.io" + case integrationName = "Customer.io Data Pipelines" case apiHost = "apiHost" case apiKey = "apiKey" } From 595301ae89eb5f7e7872229fce22d6b9f93d26d0 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Sat, 30 Mar 2024 05:19:35 +0500 Subject: [PATCH 04/11] updated sample apps --- .../project.pbxproj | 16 ++++++++-------- .../SegmentUIKitExample/AppDelegate.swift | 2 +- Examples/other_plugins/CellularCarrier.swift | 2 +- Examples/other_plugins/ConsentTracking.swift | 2 +- Examples/other_plugins/IDFACollection.swift | 2 +- .../other_plugins/NotificationTracking.swift | 2 +- Examples/other_plugins/UIKitScreenTracking.swift | 2 +- Examples/tasks/CustomScreenTracking.swift | 2 +- Examples/tasks/MultiInstance.swift | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj index 84ebe5fd..6da7dc41 100644 --- a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj +++ b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj @@ -3,10 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ + 301A7CF42BB79195007AF8A5 /* CDPAnalyticsSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */; }; 46022785261F860100A9E913 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022784261F860100A9E913 /* AppDelegate.swift */; }; 46022787261F860100A9E913 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022786261F860100A9E913 /* SceneDelegate.swift */; }; 46022789261F860100A9E913 /* Tab1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022788261F860100A9E913 /* Tab1ViewController.swift */; }; @@ -19,7 +20,6 @@ 46E3834E26582D9E00BA2502 /* IDFACollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E3834A26582D9E00BA2502 /* IDFACollection.swift */; }; 46E3835326582DA400BA2502 /* CustomScreenTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E3835126582DA400BA2502 /* CustomScreenTracking.swift */; }; 46E3835426582DA400BA2502 /* MultiInstance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E3835226582DA400BA2502 /* MultiInstance.swift */; }; - 46E383572658307800BA2502 /* Segment in Frameworks */ = {isa = PBXBuildFile; productRef = 46E383562658307800BA2502 /* Segment */; }; 46E73DA326F531320021042C /* NotificationTracking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E73DA226F531320021042C /* NotificationTracking.swift */; }; /* End PBXBuildFile section */ @@ -48,7 +48,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 46E383572658307800BA2502 /* Segment in Frameworks */, + 301A7CF42BB79195007AF8A5 /* CDPAnalyticsSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -138,7 +138,7 @@ ); name = SegmentUIKitExample; packageProductDependencies = ( - 46E383562658307800BA2502 /* Segment */, + 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */, ); productName = SegmentUIKitExample; productReference = 46022781261F860100A9E913 /* SegmentUIKitExample.app */; @@ -439,13 +439,13 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 460227A0261F887C00A9E913 /* Segment */ = { + 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */ = { isa = XCSwiftPackageProductDependency; - package = 4602279B261F884600A9E913 /* XCRemoteSwiftPackageReference "analytics-swift" */; - productName = Segment; + productName = CDPAnalyticsSwift; }; - 46E383562658307800BA2502 /* Segment */ = { + 460227A0261F887C00A9E913 /* Segment */ = { isa = XCSwiftPackageProductDependency; + package = 4602279B261F884600A9E913 /* XCRemoteSwiftPackageReference "analytics-swift" */; productName = Segment; }; /* End XCSwiftPackageProductDependency section */ diff --git a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift index 31ad90a8..0577a211 100644 --- a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift +++ b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift @@ -6,7 +6,7 @@ // import UIKit -import Segment +import CDPAnalyticsSwift @main class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/Examples/other_plugins/CellularCarrier.swift b/Examples/other_plugins/CellularCarrier.swift index 6dffc067..0cbd215f 100644 --- a/Examples/other_plugins/CellularCarrier.swift +++ b/Examples/other_plugins/CellularCarrier.swift @@ -35,7 +35,7 @@ #if os(iOS) && !targetEnvironment(macCatalyst) import Foundation -import Segment +import CDPAnalyticsSwift import CoreTelephony /** diff --git a/Examples/other_plugins/ConsentTracking.swift b/Examples/other_plugins/ConsentTracking.swift index 18a05c08..a78b4812 100644 --- a/Examples/other_plugins/ConsentTracking.swift +++ b/Examples/other_plugins/ConsentTracking.swift @@ -33,7 +33,7 @@ // SOFTWARE. import Foundation -import Segment +import CDPAnalyticsSwift import UIKit /** diff --git a/Examples/other_plugins/IDFACollection.swift b/Examples/other_plugins/IDFACollection.swift index 4ee1550c..28fea8f1 100644 --- a/Examples/other_plugins/IDFACollection.swift +++ b/Examples/other_plugins/IDFACollection.swift @@ -34,7 +34,7 @@ import Foundation import UIKit -import Segment +import CDPAnalyticsSwift import AdSupport import AppTrackingTransparency diff --git a/Examples/other_plugins/NotificationTracking.swift b/Examples/other_plugins/NotificationTracking.swift index 8346b1ec..81abc98c 100644 --- a/Examples/other_plugins/NotificationTracking.swift +++ b/Examples/other_plugins/NotificationTracking.swift @@ -36,7 +36,7 @@ #if !os(Linux) && !os(macOS) import Foundation -import Segment +import CDPAnalyticsSwift class NotificationTracking: Plugin { var type: PluginType = .utility diff --git a/Examples/other_plugins/UIKitScreenTracking.swift b/Examples/other_plugins/UIKitScreenTracking.swift index 387b0223..1aeb826a 100644 --- a/Examples/other_plugins/UIKitScreenTracking.swift +++ b/Examples/other_plugins/UIKitScreenTracking.swift @@ -33,7 +33,7 @@ // SOFTWARE. import Foundation -import Segment +import CDPAnalyticsSwift import UIKit /** diff --git a/Examples/tasks/CustomScreenTracking.swift b/Examples/tasks/CustomScreenTracking.swift index cd80d162..a9480410 100644 --- a/Examples/tasks/CustomScreenTracking.swift +++ b/Examples/tasks/CustomScreenTracking.swift @@ -31,7 +31,7 @@ import Foundation import UIKit -import Segment +import CDPAnalyticsSwift class QueryAlertController: UIAlertController { // we already conform to UIKitScreenTrackable so override diff --git a/Examples/tasks/MultiInstance.swift b/Examples/tasks/MultiInstance.swift index e762ccb7..41ad91ad 100644 --- a/Examples/tasks/MultiInstance.swift +++ b/Examples/tasks/MultiInstance.swift @@ -30,7 +30,7 @@ // SOFTWARE. import Foundation -import Segment +import CDPAnalyticsSwift /** An example of implementing multiple Analytics instances in a single application. From 690f40b708697d622df911e80fde2e8e147a6ed3 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Sat, 30 Mar 2024 14:28:22 +0500 Subject: [PATCH 05/11] updated pods with same module name --- AnalyticsSwiftCIO.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AnalyticsSwiftCIO.podspec b/AnalyticsSwiftCIO.podspec index 6da97190..091123cc 100644 --- a/AnalyticsSwiftCIO.podspec +++ b/AnalyticsSwiftCIO.podspec @@ -7,14 +7,14 @@ Pod::Spec.new do |s| s.authors = "Customer.io" # Make sure the tag is the same as what SPM customers are using. - s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => '1.5.9+cio.1' } + s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :branch => 'shahroz/different-target' } s.ios.deployment_target = "13.0" s.requires_arc = true s.swift_version = '5.3' s.cocoapods_version = '>= 1.11.0' - s.module_name = "Segment" + s.module_name = "CDPAnalyticsSwift" s.source_files = "Sources/**/*.swift" s.resource_bundles = { From d0bb0ec54450c73867cd9e8c4637bbcf46f78851 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Mon, 1 Apr 2024 13:51:11 +0500 Subject: [PATCH 06/11] added comment --- AnalyticsSwiftCIO.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/AnalyticsSwiftCIO.podspec b/AnalyticsSwiftCIO.podspec index 091123cc..b0e1f1eb 100644 --- a/AnalyticsSwiftCIO.podspec +++ b/AnalyticsSwiftCIO.podspec @@ -7,6 +7,7 @@ Pod::Spec.new do |s| s.authors = "Customer.io" # Make sure the tag is the same as what SPM customers are using. + # TODO: update it to version, once we decide to release it. s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :branch => 'shahroz/different-target' } s.ios.deployment_target = "13.0" From 8992ab8d372686961acf24190018f21c6250038a Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Thu, 2 May 2024 02:41:45 +0500 Subject: [PATCH 07/11] fixed import --- Sources/Segment/Plugins/SegmentDestination.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Segment/Plugins/SegmentDestination.swift b/Sources/Segment/Plugins/SegmentDestination.swift index d8322f8a..c4c4d54a 100644 --- a/Sources/Segment/Plugins/SegmentDestination.swift +++ b/Sources/Segment/Plugins/SegmentDestination.swift @@ -190,7 +190,7 @@ extension SegmentDestination { // we don't want to retry events in a given batch when a 400 // response for malformed JSON is returned - case .failure(Segment.HTTPClientErrors.statusCode(code: 400)): + case .failure(CDPAnalyticsSwift.HTTPClientErrors.statusCode(code: 400)): storage.remove(data: [url]) cleanupUploads() default: From 30cac1da4b7184c68830d4b95ebcb48dfc177df8 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Tue, 7 May 2024 02:29:59 +0500 Subject: [PATCH 08/11] updated name to match current modules --- AnalyticsSwiftCIO.podspec | 5 ++--- .../SegmentUIKitExample.xcodeproj/project.pbxproj | 10 +++++----- .../SegmentUIKitExample/AppDelegate.swift | 2 +- Examples/other_plugins/CellularCarrier.swift | 2 +- Examples/other_plugins/ConsentTracking.swift | 2 +- Examples/other_plugins/IDFACollection.swift | 2 +- Examples/other_plugins/NotificationTracking.swift | 2 +- Examples/other_plugins/UIKitScreenTracking.swift | 2 +- Examples/tasks/CustomScreenTracking.swift | 2 +- Examples/tasks/MultiInstance.swift | 2 +- Package.swift | 12 ++++++------ Sources/Segment/Plugins/SegmentDestination.swift | 4 ++-- Sources/Segment/Utilities/Storage/Storage.swift | 2 +- 13 files changed, 24 insertions(+), 25 deletions(-) diff --git a/AnalyticsSwiftCIO.podspec b/AnalyticsSwiftCIO.podspec index a4f2fcb7..26695499 100644 --- a/AnalyticsSwiftCIO.podspec +++ b/AnalyticsSwiftCIO.podspec @@ -7,15 +7,14 @@ Pod::Spec.new do |s| s.authors = "Customer.io" # Make sure the tag is the same as what SPM customers are using. - # TODO: update it to version, once we decide to release it. - s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :branch => 'shahroz/different-target' } + s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => '1.5.11+cio.1' } s.ios.deployment_target = "13.0" s.requires_arc = true s.swift_version = '5.3' s.cocoapods_version = '>= 1.11.0' - s.module_name = "CDPAnalyticsSwift" + s.module_name = "CioAnalytics" s.source_files = "Sources/**/*.swift" s.resource_bundles = { diff --git a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj index 6da7dc41..9251c620 100644 --- a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj +++ b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 301A7CF42BB79195007AF8A5 /* CDPAnalyticsSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */; }; + 30678B7F2BE982DC000C3E2D /* CioAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 30678B7E2BE982DC000C3E2D /* CioAnalytics */; }; 46022785261F860100A9E913 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022784261F860100A9E913 /* AppDelegate.swift */; }; 46022787261F860100A9E913 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022786261F860100A9E913 /* SceneDelegate.swift */; }; 46022789261F860100A9E913 /* Tab1ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46022788261F860100A9E913 /* Tab1ViewController.swift */; }; @@ -48,7 +48,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 301A7CF42BB79195007AF8A5 /* CDPAnalyticsSwift in Frameworks */, + 30678B7F2BE982DC000C3E2D /* CioAnalytics in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -138,7 +138,7 @@ ); name = SegmentUIKitExample; packageProductDependencies = ( - 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */, + 30678B7E2BE982DC000C3E2D /* CioAnalytics */, ); productName = SegmentUIKitExample; productReference = 46022781261F860100A9E913 /* SegmentUIKitExample.app */; @@ -439,9 +439,9 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 301A7CF32BB79195007AF8A5 /* CDPAnalyticsSwift */ = { + 30678B7E2BE982DC000C3E2D /* CioAnalytics */ = { isa = XCSwiftPackageProductDependency; - productName = CDPAnalyticsSwift; + productName = CioAnalytics; }; 460227A0261F887C00A9E913 /* Segment */ = { isa = XCSwiftPackageProductDependency; diff --git a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift index 0577a211..2d545261 100644 --- a/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift +++ b/Examples/apps/SegmentUIKitExample/SegmentUIKitExample/AppDelegate.swift @@ -6,7 +6,7 @@ // import UIKit -import CDPAnalyticsSwift +import CioAnalytics @main class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/Examples/other_plugins/CellularCarrier.swift b/Examples/other_plugins/CellularCarrier.swift index 0cbd215f..f13b8ac4 100644 --- a/Examples/other_plugins/CellularCarrier.swift +++ b/Examples/other_plugins/CellularCarrier.swift @@ -35,7 +35,7 @@ #if os(iOS) && !targetEnvironment(macCatalyst) import Foundation -import CDPAnalyticsSwift +import CioAnalytics import CoreTelephony /** diff --git a/Examples/other_plugins/ConsentTracking.swift b/Examples/other_plugins/ConsentTracking.swift index a78b4812..1084c23c 100644 --- a/Examples/other_plugins/ConsentTracking.swift +++ b/Examples/other_plugins/ConsentTracking.swift @@ -33,7 +33,7 @@ // SOFTWARE. import Foundation -import CDPAnalyticsSwift +import CioAnalytics import UIKit /** diff --git a/Examples/other_plugins/IDFACollection.swift b/Examples/other_plugins/IDFACollection.swift index 9d9648a6..1a656bdf 100644 --- a/Examples/other_plugins/IDFACollection.swift +++ b/Examples/other_plugins/IDFACollection.swift @@ -34,7 +34,7 @@ import Foundation import UIKit -import CDPAnalyticsSwift +import CioAnalytics import AdSupport import AppTrackingTransparency diff --git a/Examples/other_plugins/NotificationTracking.swift b/Examples/other_plugins/NotificationTracking.swift index 81abc98c..13efb5db 100644 --- a/Examples/other_plugins/NotificationTracking.swift +++ b/Examples/other_plugins/NotificationTracking.swift @@ -36,7 +36,7 @@ #if !os(Linux) && !os(macOS) import Foundation -import CDPAnalyticsSwift +import CioAnalytics class NotificationTracking: Plugin { var type: PluginType = .utility diff --git a/Examples/other_plugins/UIKitScreenTracking.swift b/Examples/other_plugins/UIKitScreenTracking.swift index 1aeb826a..548e2d3a 100644 --- a/Examples/other_plugins/UIKitScreenTracking.swift +++ b/Examples/other_plugins/UIKitScreenTracking.swift @@ -33,7 +33,7 @@ // SOFTWARE. import Foundation -import CDPAnalyticsSwift +import CioAnalytics import UIKit /** diff --git a/Examples/tasks/CustomScreenTracking.swift b/Examples/tasks/CustomScreenTracking.swift index a9480410..37fc787c 100644 --- a/Examples/tasks/CustomScreenTracking.swift +++ b/Examples/tasks/CustomScreenTracking.swift @@ -31,7 +31,7 @@ import Foundation import UIKit -import CDPAnalyticsSwift +import CioAnalytics class QueryAlertController: UIAlertController { // we already conform to UIKitScreenTrackable so override diff --git a/Examples/tasks/MultiInstance.swift b/Examples/tasks/MultiInstance.swift index 41ad91ad..7e6aed66 100644 --- a/Examples/tasks/MultiInstance.swift +++ b/Examples/tasks/MultiInstance.swift @@ -30,7 +30,7 @@ // SOFTWARE. import Foundation -import CDPAnalyticsSwift +import CioAnalytics /** An example of implementing multiple Analytics instances in a single application. diff --git a/Package.swift b/Package.swift index eac01942..48505ec6 100644 --- a/Package.swift +++ b/Package.swift @@ -4,7 +4,7 @@ import PackageDescription let package = Package( - name: "CDPAnalyticsSwift", + name: "CioAnalytics", platforms: [ .macOS("10.15"), .iOS("13.0"), @@ -15,8 +15,8 @@ let package = Package( products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( - name: "CDPAnalyticsSwift", - targets: ["CDPAnalyticsSwift"]), + name: "CioAnalytics", + targets: ["CioAnalytics"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -28,14 +28,14 @@ let package = Package( // 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: "CDPAnalyticsSwift", + name: "CioAnalytics", dependencies: [ .product(name: "Sovran", package: "sovran-swift"), .product(name: "JSONSafeEncoding", package: "jsonsafeencoding-swift") ], resources: [.process("Segment/Resources")]), .testTarget( - name: "CDPAnalyticsSwift-Tests", - dependencies: ["CDPAnalyticsSwift"]), + name: "CioAnalytics-Tests", + dependencies: ["CioAnalytics"]), ] ) diff --git a/Sources/Segment/Plugins/SegmentDestination.swift b/Sources/Segment/Plugins/SegmentDestination.swift index c4c4d54a..688f08dd 100644 --- a/Sources/Segment/Plugins/SegmentDestination.swift +++ b/Sources/Segment/Plugins/SegmentDestination.swift @@ -190,7 +190,7 @@ extension SegmentDestination { // we don't want to retry events in a given batch when a 400 // response for malformed JSON is returned - case .failure(CDPAnalyticsSwift.HTTPClientErrors.statusCode(code: 400)): + case .failure(CioAnalytics.HTTPClientErrors.statusCode(code: 400)): storage.remove(data: [url]) cleanupUploads() default: @@ -261,7 +261,7 @@ extension SegmentDestination { // we don't want to retry events in a given batch when a 400 // response for malformed JSON is returned - case .failure(CDPAnalyticsSwift.HTTPClientErrors.statusCode(code: 400)): + case .failure(CioAnalytics.HTTPClientErrors.statusCode(code: 400)): storage.remove(data: removable) cleanupUploads() default: diff --git a/Sources/Segment/Utilities/Storage/Storage.swift b/Sources/Segment/Utilities/Storage/Storage.swift index cb675f07..a286d14d 100644 --- a/Sources/Segment/Utilities/Storage/Storage.swift +++ b/Sources/Segment/Utilities/Storage/Storage.swift @@ -24,7 +24,7 @@ internal class Storage: Subscriber { self.storageMode = storageMode self.userDefaults = UserDefaults(suiteName: "com.segment.storage.\(writeKey)")! - var storageURL = CDPAnalyticsSwift.eventStorageDirectory(writeKey: writeKey) + var storageURL = CioAnalytics.eventStorageDirectory(writeKey: writeKey) let asyncAppend = (operatingMode == .asynchronous) switch storageMode { case .diskAtURL(let url): From 7ef70057ce69d8c542c58d508ae5e721382ed374 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Tue, 7 May 2024 03:15:33 +0500 Subject: [PATCH 09/11] updated obj-c symbols --- .../ObjCExample/ObjCExample/TestDestination.swift | 2 +- Sources/Segment/ObjC/ObjCAnalytics.swift | 2 +- Sources/Segment/ObjC/ObjCConfiguration.swift | 2 +- Sources/Segment/ObjC/ObjCEvents.swift | 14 +++++++------- Sources/Segment/ObjC/ObjCPlugin.swift | 8 ++++---- Tests/Segment-Tests/Support/TestUtilities.swift | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Examples/apps/ObjCExample/ObjCExample/TestDestination.swift b/Examples/apps/ObjCExample/ObjCExample/TestDestination.swift index 23846958..cf977b90 100644 --- a/Examples/apps/ObjCExample/ObjCExample/TestDestination.swift +++ b/Examples/apps/ObjCExample/ObjCExample/TestDestination.swift @@ -8,7 +8,7 @@ import Foundation import Segment -@objc(SEGTestDestination) +@objc(CIOTestDestination) public class ObjCTestDestination: NSObject, ObjCPlugin, ObjCPluginShim { public func instance() -> EventPlugin { return TestDestination() } } diff --git a/Sources/Segment/ObjC/ObjCAnalytics.swift b/Sources/Segment/ObjC/ObjCAnalytics.swift index d5883ec0..d2c80322 100644 --- a/Sources/Segment/ObjC/ObjCAnalytics.swift +++ b/Sources/Segment/ObjC/ObjCAnalytics.swift @@ -12,7 +12,7 @@ import JSONSafeEncoding // MARK: - ObjC Compatibility -@objc(SEGAnalytics) +@objc(CIOAnalytics) public class ObjCAnalytics: NSObject { /// The underlying Analytics object we're working with public let analytics: Analytics diff --git a/Sources/Segment/ObjC/ObjCConfiguration.swift b/Sources/Segment/ObjC/ObjCConfiguration.swift index 87117991..f80a0bea 100644 --- a/Sources/Segment/ObjC/ObjCConfiguration.swift +++ b/Sources/Segment/ObjC/ObjCConfiguration.swift @@ -10,7 +10,7 @@ import Foundation import JSONSafeEncoding -@objc(SEGConfiguration) +@objc(CIOConfiguration) public class ObjCConfiguration: NSObject { internal var configuration: Configuration diff --git a/Sources/Segment/ObjC/ObjCEvents.swift b/Sources/Segment/ObjC/ObjCEvents.swift index 019a7b6a..5d8081cd 100644 --- a/Sources/Segment/ObjC/ObjCEvents.swift +++ b/Sources/Segment/ObjC/ObjCEvents.swift @@ -14,7 +14,7 @@ internal protocol ObjCEvent { var _event: EventType { get set } } -@objc(SEGDestinationMetadata) +@objc(CIODestinationMetadata) public class ObjCDestinationMetadata: NSObject { internal var _metadata: DestinationMetadata @@ -43,7 +43,7 @@ public class ObjCDestinationMetadata: NSObject { } } -@objc(SEGRawEvent) +@objc(CIORawEvent) public protocol ObjCRawEvent: NSObjectProtocol { var type: String? { get } var messageId: String? { get } @@ -80,7 +80,7 @@ internal func objcEventFromEvent(_ event: T?) -> ObjCRawEvent? { } } -@objc(SEGTrackEvent) +@objc(CIOTrackEvent) public class ObjCTrackEvent: NSObject, ObjCEvent, ObjCRawEvent { internal var _event: TrackEvent @@ -139,7 +139,7 @@ public class ObjCTrackEvent: NSObject, ObjCEvent, ObjCRawEvent { } } -@objc(SEGIdentifyEvent) +@objc(CIOIdentifyEvent) public class ObjCIdentifyEvent: NSObject, ObjCEvent, ObjCRawEvent { internal var _event: IdentifyEvent @@ -192,7 +192,7 @@ public class ObjCIdentifyEvent: NSObject, ObjCEvent, ObjCRawEvent { } } -@objc(SEGScreenEvent) +@objc(CIOScreenEvent) public class ObjCScreenEvent: NSObject, ObjCEvent, ObjCRawEvent { internal var _event: ScreenEvent @@ -257,7 +257,7 @@ public class ObjCScreenEvent: NSObject, ObjCEvent, ObjCRawEvent { } } -@objc(SEGGroupEvent) +@objc(CIOGroupEvent) public class ObjCGroupEvent: NSObject, ObjCEvent, ObjCRawEvent { internal var _event: GroupEvent @@ -316,7 +316,7 @@ public class ObjCGroupEvent: NSObject, ObjCEvent, ObjCRawEvent { } } -@objc(SEGAliasEvent) +@objc(CIOAliasEvent) public class ObjCAliasEvent: NSObject, ObjCEvent, ObjCRawEvent { internal var _event: AliasEvent diff --git a/Sources/Segment/ObjC/ObjCPlugin.swift b/Sources/Segment/ObjC/ObjCPlugin.swift index 1396d670..5687b0bb 100644 --- a/Sources/Segment/ObjC/ObjCPlugin.swift +++ b/Sources/Segment/ObjC/ObjCPlugin.swift @@ -10,7 +10,7 @@ import Foundation -@objc(SEGPlugin) +@objc(CIOPlugin) public protocol ObjCPlugin {} public protocol ObjCPluginShim { @@ -20,14 +20,14 @@ public protocol ObjCPluginShim { // NOTE: Destination plugins need something similar to the following to work/ /* -@objc(SEGMixpanelDestination) +@objc(CIOMixpanelDestination) public class ObjCSegmentMixpanel: NSObject, ObjCPlugin, ObjCPluginShim { public func instance() -> EventPlugin { return MixpanelDestination() } } */ -@objc(SEGEventPlugin) +@objc(CIOEventPlugin) public class ObjCEventPlugin: NSObject, EventPlugin, ObjCPlugin { public var type: PluginType = .enrichment public weak var analytics: Analytics? = nil @@ -48,7 +48,7 @@ public class ObjCEventPlugin: NSObject, EventPlugin, ObjCPlugin { } } -@objc(SEGBlockPlugin) +@objc(CIOBlockPlugin) public class ObjCBlockPlugin: ObjCEventPlugin { let block: (ObjCRawEvent?) -> ObjCRawEvent? diff --git a/Tests/Segment-Tests/Support/TestUtilities.swift b/Tests/Segment-Tests/Support/TestUtilities.swift index 124daa64..b7bbab47 100644 --- a/Tests/Segment-Tests/Support/TestUtilities.swift +++ b/Tests/Segment-Tests/Support/TestUtilities.swift @@ -68,7 +68,7 @@ class ZiggyPlugin: EventPlugin { #if !os(Linux) -@objc(SEGMyDestination) +@objc(CIOMyDestination) public class ObjCMyDestination: NSObject, ObjCPlugin, ObjCPluginShim { public func instance() -> EventPlugin { return MyDestination() } } From e350caad196b29ff3231b71d239c73d9bd3487a9 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Tue, 7 May 2024 03:34:47 +0500 Subject: [PATCH 10/11] updated to test --- AnalyticsSwiftCIO.podspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AnalyticsSwiftCIO.podspec b/AnalyticsSwiftCIO.podspec index 26695499..c3951768 100644 --- a/AnalyticsSwiftCIO.podspec +++ b/AnalyticsSwiftCIO.podspec @@ -7,7 +7,8 @@ Pod::Spec.new do |s| s.authors = "Customer.io" # Make sure the tag is the same as what SPM customers are using. - s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => '1.5.11+cio.1' } + # update branch to version + s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :branch => 'shahroz/different-target' } s.ios.deployment_target = "13.0" s.requires_arc = true From 31a8a935471b844205383f5b80167f0dddf3eda9 Mon Sep 17 00:00:00 2001 From: Shahroz Khan Date: Tue, 7 May 2024 12:34:45 +0500 Subject: [PATCH 11/11] version fixed --- AnalyticsSwiftCIO.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AnalyticsSwiftCIO.podspec b/AnalyticsSwiftCIO.podspec index c3951768..85ce39ff 100644 --- a/AnalyticsSwiftCIO.podspec +++ b/AnalyticsSwiftCIO.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "AnalyticsSwiftCIO" - s.version = "1.5.11+cio.1" + s.version = "1.5.12+cio.1" s.license = { :type => 'MIT', :file => './LICENSE' } s.summary = "Customer.io Data Pipelines analytics client for Swift app (iOS/tvOS/watchOS/macOS/Linux)." s.homepage = "https://github.com/customerio/cdp-analytics-swift" @@ -8,7 +8,7 @@ Pod::Spec.new do |s| # Make sure the tag is the same as what SPM customers are using. # update branch to version - s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :branch => 'shahroz/different-target' } + s.source = { :git => 'https://github.com/customerio/cdp-analytics-swift.git', :tag => '1.5.12+cio.1' } s.ios.deployment_target = "13.0" s.requires_arc = true