From bc091f5ea07a3502261d7336ea6b0dbb69473283 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Mon, 27 Mar 2023 09:18:41 -0700 Subject: [PATCH 1/2] Added objc support. --- Package.resolved | 8 ++++---- Package.swift | 2 +- Sources/SegmentMixpanel/MixpanelDestination.swift | 7 +++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Package.resolved b/Package.resolved index b1d2038..8bad38a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/segmentio/analytics-swift.git", "state": { "branch": null, - "revision": "76316a5009502de6e7c2788c295e9afc68793cd3", - "version": "1.1.2" + "revision": "26f23a2ae9b8dd47aeee1bdaa1e203f3bed6044e", + "version": "1.4.0" } }, { @@ -15,8 +15,8 @@ "repositoryURL": "https://github.com/mixpanel/mixpanel-swift", "state": { "branch": null, - "revision": "b1ff3fd1b5cb6e0228938e8008320ebfe701b3e4", - "version": "3.1.5" + "revision": "17642e5982664c3c72fa401627e4972966a6a597", + "version": "4.1.0" } }, { diff --git a/Package.swift b/Package.swift index 0b30308..d9426a8 100644 --- a/Package.swift +++ b/Package.swift @@ -23,7 +23,7 @@ let package = Package( .package( name: "Segment", url: "https://github.com/segmentio/analytics-swift.git", - from: "1.1.2" + from: "1.4.0" ), .package( name: "Mixpanel", diff --git a/Sources/SegmentMixpanel/MixpanelDestination.swift b/Sources/SegmentMixpanel/MixpanelDestination.swift index 4d1b89b..0292587 100644 --- a/Sources/SegmentMixpanel/MixpanelDestination.swift +++ b/Sources/SegmentMixpanel/MixpanelDestination.swift @@ -31,6 +31,13 @@ import Foundation import Segment import Mixpanel + +@objc(SEGMixpanelDestination) +public class ObjCSegmentMixpanel: NSObject, ObjCDestination, ObjCDestinationShim { + public func instance() -> DestinationPlugin { return MixpanelDestination() } +} + + public class MixpanelDestination: DestinationPlugin, RemoteNotifications { public let timeline = Timeline() public let type = PluginType.destination From e79f1febebad094da4223469bc3b0b1dfecb00a7 Mon Sep 17 00:00:00 2001 From: Brandon Sneed Date: Mon, 27 Mar 2023 09:26:49 -0700 Subject: [PATCH 2/2] Updated example project with the correct analytics-swift version. --- Example/BasicExample/BasicExample.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Example/BasicExample/BasicExample.xcodeproj/project.pbxproj b/Example/BasicExample/BasicExample.xcodeproj/project.pbxproj index 7f1f78c..05d75b4 100644 --- a/Example/BasicExample/BasicExample.xcodeproj/project.pbxproj +++ b/Example/BasicExample/BasicExample.xcodeproj/project.pbxproj @@ -609,7 +609,7 @@ repositoryURL = "https://github.com/segmentio/analytics-swift"; requirement = { kind = upToNextMajorVersion; - minimumVersion = 1.1.2; + minimumVersion = 1.4.0; }; }; 823B068B28E6199200E8899C /* XCRemoteSwiftPackageReference "mixpanel-swift" */ = { diff --git a/Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0879c1f..d998217 100644 --- a/Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Example/BasicExample/BasicExample.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/segmentio/analytics-swift", "state": { "branch": null, - "revision": "76316a5009502de6e7c2788c295e9afc68793cd3", - "version": "1.1.2" + "revision": "26f23a2ae9b8dd47aeee1bdaa1e203f3bed6044e", + "version": "1.4.0" } }, {