Add macOS platform support to resolve dependency conflicts - #33
Merged
Merged
Conversation
Fixes platform version mismatch when SegmentAmplitude and analytics-swift are used together in multi-platform projects. Previously, projects would fail to build because analytics-swift requires macOS 10.15+ but SegmentAmplitude didn't declare macOS support. Changes: - Add .macOS(.v10_15) to Package.swift platforms array - Make UIKit import conditional for macOS compatibility - Refactor lifecycle handling into platform-specific extensions - Add macOSLifecycle protocol support for session tracking on macOS All platforms (iOS, tvOS, watchOS, macOS) now use consistent session management logic while respecting platform-specific lifecycle APIs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bsneed
approved these changes
Feb 6, 2026
Update actions/checkout from v2 to v4 and actions/cache from v2 to v4 to resolve CI failures due to deprecated action versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds macOS 10.15+ platform support to resolve dependency conflicts when SegmentAmplitude and analytics-swift are used together in multi-platform projects.
Problem
When both Analytics Swift and the Segment Amplitude plugin are added to the same project as dependencies, the project fails to build due to a platform version mismatch:
This occurs because:
analytics-swiftrequires macOS 10.15+SegmentAmplitudedid not declare macOS support in Package.swiftSolution
Package.swift:
.macOS(.v10_15)to platforms array to match analytics-swift dependency requirementAmplitudeSession.swift:
#if !os(macOS))iOSLifecycleprotocol withUIApplication?parameterswatchOSLifecycleprotocol withWKExtensionparametersmacOSLifecycleprotocol with no parameters (new!)All platforms use the same session management logic (
startNewSessionIfNecessary(), timeout handling, etc.) while respecting platform-specific lifecycle APIs.Test Plan
swift build)Changes
Package.swift: Added macOS 10.15+ to platforms arraySources/SegmentAmplitude/AmplitudeSession.swift: Platform-specific lifecycle extensionsFiles Changed: 2 files, +37 insertions, -17 deletions
Backward Compatibility
✅ Fully backward compatible - no breaking changes to existing iOS, tvOS, or watchOS functionality.
🤖 Generated with Claude Code