diff --git a/.changeset/v4-major-release.md b/.changeset/v4-major-release.md index 26af029727..24f885bfd7 100644 --- a/.changeset/v4-major-release.md +++ b/.changeset/v4-major-release.md @@ -6,6 +6,7 @@ PostHog iOS 4.0. Every breaking change below names what to use instead. **Changed** +- **Breaking:** stop publishing PostHog to CocoaPods: install it with Swift Package Manager (3.x versions stay on CocoaPods). - **Breaking:** raise the minimum deployment targets to iOS 15.0 (from 13.0, Mac Catalyst follows iOS), macOS 11.0 (from 10.15), tvOS 15.0 (from 13.0) and watchOS 10.0 (from 6.0). - **Breaking:** require Xcode 26 or later (`swift-tools-version` 6.2) to build PostHog; the SDK still compiles in Swift 5 language mode. - **Breaking:** pass a `PostHogFeatureFlagsLoaded` to the `reloadFeatureFlags(_:)` callback, whose `errorsLoading` is `true` when the reload failed. Update closures to `{ result in ... }` (or `{ _ in ... }`); in Objective-C the block takes a `PostHogFeatureFlagsLoaded *`. diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml index 764750646e..c87a83d75e 100644 --- a/.github/workflows/build-examples.yml +++ b/.github/workflows/build-examples.yml @@ -58,34 +58,3 @@ jobs: xcode-version: latest-stable - name: Build XCFramework Example run: make buildExampleXCFramework - - build-pods: - runs-on: ${{ matrix.runner }} - strategy: - fail-fast: false - matrix: - include: - - name: Static Lib - target: buildExamplePodsStaticLib - runner: macos-15 - xcode-version: latest-stable - - name: Static Lib (Xcode 26.0.1) - target: buildExamplePodsStaticLib - runner: macos-15-xlarge - xcode-version: '26.0.1' - - name: Static Framework - target: buildExamplePodsStaticFramework - runner: macos-15 - xcode-version: latest-stable - - name: Dynamic Framework - target: buildExamplePodsDynamicFramework - runner: macos-15 - xcode-version: latest-stable - name: Example Pods (${{ matrix.name }}) - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 - with: - xcode-version: ${{ matrix.xcode-version }} - - name: Build Pods Example (${{ matrix.name }}) - run: make ${{ matrix.target }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 303abf7ecd..377aa44f37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,36 +92,3 @@ jobs: - name: Build SDK via Swift Package Manager with package traits off if: needs.detect-markdown-only.outputs.markdown_only != 'true' run: make buildSdkSpmNoTraits - - name: Install CocoaPods - if: needs.detect-markdown-only.outputs.markdown_only != 'true' - run: gem install cocoapods - - name: Install Pods - if: needs.detect-markdown-only.outputs.markdown_only != 'true' - run: | - cd PostHogExampleWithPods - USE_FRAMEWORKS=static pod install - - name: Build SDK with Swift 5 language mode via CocoaPods - if: needs.detect-markdown-only.outputs.markdown_only != 'true' - run: | - set -o pipefail - cd PostHogExampleWithPods - xcrun xcodebuild clean build \ - -workspace PostHogExampleWithPods.xcworkspace \ - -scheme PostHogExampleWithPods \ - -destination generic/platform=ios \ - SWIFT_VERSION=5 | xcpretty - - podspec-lint: - needs: detect-markdown-only - if: needs.detect-markdown-only.outputs.markdown_only != 'true' - runs-on: macos-15 - name: CocoaPods package lint - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 - with: - xcode-version: latest-stable - - name: Install CocoaPods - run: gem install cocoapods - - name: Lint podspec - run: pod lib lint PostHog.podspec --allow-warnings --skip-tests diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 625ccaf6ba..a79e8edb01 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -231,8 +231,6 @@ jobs: echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT" echo "Version to release: $NEW_VERSION" - # Tag must be pushed to remote before CocoaPods publish, because - # `pod trunk push` validates by cloning the repo at this tag from GitHub. - name: Tag and push to GitHub env: RELEASE_VERSION: ${{ steps.get-version.outputs.version }} @@ -294,99 +292,11 @@ jobs: message: '❌ Failed to create the GitHub release for `posthog-ios@v${{ steps.get-version.outputs.version }}`! ' emoji_reaction: 'x' - publish-cocoapods: - name: Publish to CocoaPods - needs: [create-github-release, notify-approval-needed] - runs-on: macos-15 - if: always() && needs.create-github-release.result == 'success' - permissions: - contents: read - env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} # Using @ioannisj token - steps: - - name: Checkout repository - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - ref: ${{ needs.create-github-release.outputs.version }} - fetch-depth: 0 - - - uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 - with: - xcode-version: '26.0.1' - - - name: Publish to CocoaPods - env: - RELEASE_VERSION: ${{ needs.create-github-release.outputs.version }} - run: | - set -euo pipefail - - on_trunk() { - pod trunk info PostHog --no-ansi 2>/dev/null \ - | grep -E -- "^[[:space:]]*- ${RELEASE_VERSION//./\\.} \(" - } - - if make releaseCocoaPods; then - exit 0 - fi - - # `pod trunk push` regularly exits non-zero *after* the spec is already - # accepted (its final CDN/response verification times out). Trunk - # registration and the `pod trunk info` endpoint can lag a bit and the - # info call itself is occasionally flaky, so poll rather than check once. - echo "::warning::pod trunk push failed. Polling pod trunk info to confirm the version landed..." - for attempt in $(seq 1 10); do - if on_trunk; then - echo "PostHog $RELEASE_VERSION is on trunk (attempt $attempt/10). Treating as success." - exit 0 - fi - if [ "$attempt" -lt 10 ]; then - echo "Not visible yet (attempt $attempt/10); retrying in 30s..." - sleep 30 - fi - done - - echo "::error::PostHog $RELEASE_VERSION is not on trunk after polling for ~5 minutes." - exit 1 - - # Notify in case of failure - - name: Send failure event to PostHog - if: ${{ failure() }} - continue-on-error: true - uses: PostHog/posthog-github-action@9a6a19d360820ab4d95ecc4a5a7564062c895f84 # v1.3.0 - with: - posthog-token: '${{ secrets.POSTHOG_PROJECT_API_KEY }}' - event: 'posthog-sdk-github-release-workflow-failure' - properties: >- - { - "commitSha": "${{ github.sha }}", - "jobStatus": "${{ job.status }}", - "ref": "${{ github.ref }}", - "repository": "${{ github.repository }}", - "sdk": "posthog-ios", - "jobName": "publish-cocoapods", - "packageName": "posthog-ios", - "packageVersion": "${{ needs.create-github-release.outputs.version || 'unknown' }}", - "actionUrl": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", - "alertText": ":rotating_light: Failed to publish posthog-ios@v${{ needs.create-github-release.outputs.version }} to CocoaPods :rotating_light:", - "alertContext": "The CocoaPods publish step failed." - } - - - name: Notify Slack - Failed - continue-on-error: true - if: ${{ failure() && needs.notify-approval-needed.outputs.slack_ts != '' }} - uses: PostHog/.github/.github/actions/slack-thread-reply@cb0979b67dcd585828b61ac45927eef4da8f6287 # main - with: - slack_bot_token: ${{ secrets.SLACK_CLIENT_LIBRARIES_BOT_TOKEN }} - slack_channel_id: ${{ vars.SLACK_APPROVALS_CLIENT_LIBRARIES_CHANNEL_ID }} - thread_ts: ${{ needs.notify-approval-needed.outputs.slack_ts }} - message: '❌ Failed to publish `posthog-ios@v${{ needs.create-github-release.outputs.version }}` to CocoaPods! ' - emoji_reaction: 'x' - notify-released: name: Notify Slack - Released - needs: [notify-approval-needed, publish-cocoapods] + needs: [notify-approval-needed, create-github-release] runs-on: ubuntu-latest - if: always() && needs.publish-cocoapods.result == 'success' && needs.notify-approval-needed.outputs.slack_ts != '' + if: always() && needs.create-github-release.result == 'success' && needs.notify-approval-needed.outputs.slack_ts != '' steps: - name: Notify Slack - Released continue-on-error: true diff --git a/.swiftlint.yml b/.swiftlint.yml index 639bbe95da..a8a2bcd104 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,7 +9,6 @@ excluded: # case-sensitive paths to ignore during linting. Takes precedence over - PostHogExampleWatchOS - PostHogExampleWidget - PostHogExampleWidgetAppGroup - - PostHogExampleWithPods - PostHogExampleWithSPM - PostHogTests - PostHogSurveyUITests diff --git a/AGENTS.md b/AGENTS.md index 55adb42422..eb66b51f8c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ ## Repository invariants - Maintain Swift 5 SDK language mode. The package needs swift-tools-version 6.2 (Xcode 26+); prefer Swift Testing for new tests. Use `PostHogTests/TestUtils/MockPostHogServer.swift` for HTTP stubbing. -- Preserve deployment minima: iOS 15, tvOS 15, macOS 11, watchOS 10, visionOS 1. Keep platform guards and graceful degradation, especially for session replay. Availability annotations/checks do not require adding platform support or raising targets. Intentional support changes require checking `Package.swift` plus CocoaPods/Xcode packaging/build configuration. +- Preserve deployment minima: iOS 15, tvOS 15, macOS 11, watchOS 10, visionOS 1. Keep platform guards and graceful degradation, especially for session replay. Availability annotations/checks do not require adding platform support or raising targets. Intentional support changes require checking `Package.swift` plus the Xcode project build configuration. - Public APIs must remain thread-safe and callable from any thread. Preserve offline operation and queue-based event batching; never assume connectivity. `PostHogSDK.shared` is the default singleton; independent instances use `PostHogSDK.with(_:)` with `PostHogConfig`. - Preserve replay masking/privacy behavior and privacy-safe error logging; do not expose sensitive user data. - Prefer no new dependencies. libwebp is embedded; PHPLCrashReporter is vendored, prefixed PLCrashReporter for native crash reporting on iOS/macOS/tvOS, excluded on watchOS/visionOS. Both are behind default-on package traits (`SessionReplay`, which also gates the replay engine, and `CrashReporting`); gate code that uses them with `#if !SWIFT_PACKAGE || `. The survey engine and UI are behind the default-on `Surveys` trait the same way. Once released, never add a new default-on trait on its own: apps that list traits would silently lose the feature. Split an existing trait instead, keeping it as an umbrella that enables the new ones. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ffbe42f50f..ed28e5e8b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ This repo requires all commits to be signed. To configure commit signing, see th Use the repository's `make` wrappers rather than invoking `swift` or `xcodebuild` directly; [Makefile](Makefile) owns the commands and options. -For initial setup, install Xcode 26 or later and, if needed, use `make bootstrap` to install CocoaPods, xcpretty, SwiftLint, SwiftFormat and Periphery. Agents should report missing prerequisites rather than install tools without authorization. The package uses swift-tools-version 6.2 and compiles in Swift 5 language mode; use current stable Xcode as CI does. +For initial setup, install Xcode 26 or later and, if needed, use `make bootstrap` to install xcpretty, SwiftLint, SwiftFormat and Periphery. Agents should report missing prerequisites rather than install tools without authorization. The package uses swift-tools-version 6.2 and compiles in Swift 5 language mode; use current stable Xcode as CI does. Iterate with focused checks, then run the core CI-aligned checks before submitting **SDK changes**: @@ -43,10 +43,9 @@ Markdown-only changes need documentation/link checks and `git diff --check`, not | SDK across supported platforms, including Mac Catalyst | `make buildSdk` | | Code gated by the `SessionReplay`, `CrashReporting` or `Surveys` package traits | `make buildSdkSpmNoTraits`, `make testNoTraits`, `make buildTestsSpmTraitsIOS` | | Example/platform integrations | `make buildExamplesPlatforms` | -| CocoaPods integration modes | `make buildExamplePodsStaticLib`, `make buildExamplePodsStaticFramework`, `make buildExamplePodsDynamicFramework` | | XCFramework integration | `make buildExampleXCFramework` | -Use relevant example/package checks for integration or packaging changes, and smoke test changed behavior in an example where applicable. `make buildExamples` runs all example builds; `make build` combines that with `make buildSdk`. These broad targets include CocoaPods installation and XCFramework generation, so they are not the default iteration loop. For package/support changes, also consult the package lint and minimum-toolchain lanes in [build CI](.github/workflows/build.yml) and [example CI](.github/workflows/build-examples.yml). +Use relevant example/package checks for integration or packaging changes, and smoke test changed behavior in an example where applicable. `make buildExamples` runs all example builds; `make build` combines that with `make buildSdk`. These broad targets include XCFramework generation, so they are not the default iteration loop. For package/support changes, also consult the public API and minimum-toolchain lanes in [build CI](.github/workflows/build.yml) and [example CI](.github/workflows/build-examples.yml). ### Simulator, UI and masking prerequisites diff --git a/Makefile b/Makefile index a1ac45f1a4..462f7b7dd6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: testSurveyUI build buildSdk buildExamples format swiftLint swiftFormat swiftLintCheck swiftFormatCheck installSwiftLint installSwiftFormat test testUploadSymbols recordEventShapeSnapshots testDowngradeCompatibility checkTestRegistration testOniOSSimulator testOnMacSimulator maskSnapshots recordMaskSnapshots checkMaskSnapshotRuntime lint bootstrap releaseCocoaPods api apiCheck apiUpdate buildIOS buildSdkSpm buildSdkSpmNoTraits buildTestsSpmTraitsIOS testNoTraits +.PHONY: testSurveyUI build buildSdk buildExamples format swiftLint swiftFormat swiftLintCheck swiftFormatCheck installSwiftLint installSwiftFormat test testUploadSymbols recordEventShapeSnapshots testDowngradeCompatibility checkTestRegistration testOniOSSimulator testOnMacSimulator maskSnapshots recordMaskSnapshots checkMaskSnapshotRuntime lint bootstrap api apiCheck apiUpdate buildIOS buildSdkSpm buildSdkSpmNoTraits buildTestsSpmTraitsIOS testNoTraits build: buildSdk buildExamples @@ -35,12 +35,6 @@ buildTestsSpmTraitsIOS: buildExamples: \ buildExamplesPlatforms \ buildExampleXCFramework \ - buildExamplePods \ - -buildExamplePods: \ - buildExamplePodsStaticLib \ - buildExamplePodsStaticFramework \ - buildExamplePodsDynamicFramework \ buildExamplesPlatforms: set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExample -destination generic/platform=ios | xcpretty #ios @@ -54,30 +48,6 @@ buildExamplesPlatforms: set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExampleStoryboard -destination generic/platform=ios | xcpretty #Storyboard set -o pipefail && xcrun xcodebuild clean build -scheme PostHogExampleWithSPM -destination 'platform=macOS,variant=Mac Catalyst' | xcpretty #Mac Catalyst SPM -buildExamplePodsDynamicFramework: - cd PostHogExampleWithPods && \ - USE_FRAMEWORKS=dynamic pod install && cd .. && \ - set -o pipefail && xcrun xcodebuild clean build \ - -workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace \ - -scheme PostHogExampleWithPods \ - -destination generic/platform=ios | xcpretty - -buildExamplePodsStaticFramework: - cd PostHogExampleWithPods && \ - USE_FRAMEWORKS=static pod install && cd .. && \ - set -o pipefail && xcrun xcodebuild clean build \ - -workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace \ - -scheme PostHogExampleWithPods \ - -destination generic/platform=ios | xcpretty - -buildExamplePodsStaticLib: - cd PostHogExampleWithPods && \ - pod install && cd .. && \ - set -o pipefail && xcrun xcodebuild clean archive \ - -workspace PostHogExampleWithPods/PostHogExampleWithPods.xcworkspace \ - -scheme PostHogExampleWithPods \ - -destination generic/platform=ios | xcpretty - buildExampleXCFramework: ./PostHogExampleExternalSDK/build_xcframework.sh set -o pipefail && xcrun xcodebuild clean build \ @@ -251,19 +221,7 @@ apiUpdate: # requires gem and brew # xcpretty needs 'export LANG=en_US.UTF-8' bootstrap: - gem install cocoapods gem install xcpretty brew install swiftlint brew install swiftformat brew install peripheryapp/periphery/periphery - -# download SDKs and runtimes -# create Apple Vision Pro simulator if missing -# release pod -releaseCocoaPods: - set -o pipefail && xcrun xcodebuild -downloadAllPlatforms - @if ! xcrun simctl list devices | grep -q "Apple Vision Pro"; then \ - LATEST_RUNTIME=$$(xcrun simctl list runtimes | grep "com.apple.CoreSimulator.SimRuntime.xrOS" | sort -r | head -n 1 | awk '{print $$NF}') && \ - xcrun simctl create "Apple Vision Pro" "Apple Vision Pro" "$$LATEST_RUNTIME"; \ - fi - pod trunk push PostHog.podspec --allow-warnings \ No newline at end of file diff --git a/PostHog.podspec b/PostHog.podspec deleted file mode 100644 index 5508fb0e58..0000000000 --- a/PostHog.podspec +++ /dev/null @@ -1,76 +0,0 @@ -Pod::Spec.new do |s| - s.name = "PostHog" - s.version = "3.92.5" - s.summary = "The hassle-free way to add posthog to your iOS app." - - s.description = <<-DESC - PostHog for iOS provides a single API that lets you - integrate with over 100s of tools. - DESC - - s.homepage = "http://posthog.com/" - s.license = { :type => 'MIT' } - s.author = { "PostHog" => "engineering@posthog.com" } - s.source = { :git => "https://github.com/PostHog/posthog-ios.git", :tag => s.version.to_s } - s.social_media_url = 'https://twitter.com/PostHog' - s.readme = "https://raw.githubusercontent.com/PostHog/posthog-ios/#{s.version.to_s}/README.md" - s.changelog = "https://raw.githubusercontent.com/PostHog/posthog-ios/#{s.version.to_s}/CHANGELOG.md" - - s.ios.deployment_target = '15.0' - s.tvos.deployment_target = '15.0' - s.osx.deployment_target = "11.0" - s.watchos.deployment_target = "10.0" - s.visionos.deployment_target = "1.0" - s.swift_versions = "5.3" - - s.frameworks = 'Foundation' - - # Vendored PLCrashReporter source (not available on watchOS/visionOS) - s.libraries = 'c++' - s.pod_target_xcconfig = { - 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES', - 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) PLCR_PRIVATE PLCF_RELEASE_BUILD PLCRASHREPORTER_PREFIX=PH SWIFT_PACKAGE', - # Static-library source pods cannot resolve the underlying Objective-C module - # while verifying the emitted Swift interface. Xcode 16.2 still schedules - # verification when the build setting is NO, so pass the compiler flag as well. - 'SWIFT_VERIFY_EMITTED_MODULE_INTERFACE' => 'NO', - 'OTHER_SWIFT_FLAGS' => '$(inherited) -no-verify-emitted-module-interface', - 'HEADER_SEARCH_PATHS' => '$(inherited) "${PODS_TARGET_SRCROOT}/vendor/PHPLCrashReporter/Source"', - 'SWIFT_INCLUDE_PATHS' => '$(inherited) "${PODS_TARGET_SRCROOT}/PostHog/PrivateModules/phlibwebp" "${PODS_TARGET_SRCROOT}/PostHog/PrivateModules/PHPLCrashReporter" "${PODS_TARGET_SRCROOT}/PostHog/PrivateModules/PostHogObjCExceptionSupport"' - } - - s.source_files = [ - 'PostHog/**/*.{swift,h,hpp,m,mm,c,cpp}', - 'vendor/libwebp/**/*.{h,c}', - 'vendor/PHPLCrashReporter/Source/**/*.{h,hpp,m,mm,c,cpp,S}' - ] - - # Only PostHog's umbrella header should be public; vendored implementation headers stay private. - s.public_header_files = 'PostHog/PostHog.h' - s.private_header_files = [ - 'PostHog/ObjCExceptionSupport/PHObjCExceptionCatcher.h', - 'PostHog/ObjCExceptionSupport/PHURLSessionTaskSafeAccess.h', - 'vendor/libwebp/**/*.h', - 'vendor/PHPLCrashReporter/Source/**/*.{h,hpp}' - ] - - # Crash reporting is not supported on watchOS/visionOS - s.watchos.exclude_files = [ - 'vendor/PHPLCrashReporter/Source/**/*', - 'vendor/PHPLCrashReporter/Dependencies/**/*' - ] - s.visionos.exclude_files = [ - 'vendor/PHPLCrashReporter/Source/**/*', - 'vendor/PHPLCrashReporter/Dependencies/**/*' - ] - s.exclude_files = [ - 'vendor/PHPLCrashReporter/Source/PLCrashReport.proto' - ] - s.resource_bundles = { - 'PostHog' => 'PostHog/Resources/PrivacyInfo.xcprivacy', - 'PHPLCrashReporter' => 'vendor/PHPLCrashReporter/Resources/PrivacyInfo.xcprivacy' - } - - # Include the upload script and vendored notices in source distributions - s.preserve_paths = ['build-tools/upload-symbols.sh', 'vendor/PHPLCrashReporter/LICENSE', 'vendor/libwebp/COPYING', 'vendor/libwebp/PATENTS', 'PostHog/PrivateModules/**/*.modulemap'] -end diff --git a/PostHog.xcodeproj/project.pbxproj b/PostHog.xcodeproj/project.pbxproj index 1528a4b624..f52941fee5 100644 --- a/PostHog.xcodeproj/project.pbxproj +++ b/PostHog.xcodeproj/project.pbxproj @@ -655,13 +655,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 690FF0332AE7C5BB00A0B06B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 690FF02F2AE7C5BA00A0B06B /* PostHogExampleWithPods.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 690FF01E2AE7C5B900A0B06B; - remoteInfo = PostHogExampleWithPods; - }; 690FF0572AE7DB3700A0B06B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 690FF0532AE7DB3700A0B06B /* PostHogExampleWithSPM.xcodeproj */; @@ -951,7 +944,6 @@ 64F80D1792DC64921EF42266 /* PLCrashAsyncDwarfCFAState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = PLCrashAsyncDwarfCFAState.cpp; path = vendor/PHPLCrashReporter/Source/PLCrashAsyncDwarfCFAState.cpp; sourceTree = ""; }; 68181997A5803BEDE63ABDEA /* PostHogLogRecord.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PostHogLogRecord.swift; sourceTree = ""; }; 690B2DF22C205B5600AE3B45 /* TimeBasedEpochGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeBasedEpochGenerator.swift; sourceTree = ""; }; - 690FF02F2AE7C5BA00A0B06B /* PostHogExampleWithPods.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PostHogExampleWithPods.xcodeproj; path = PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj; sourceTree = ""; }; 690FF0532AE7DB3700A0B06B /* PostHogExampleWithSPM.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PostHogExampleWithSPM.xcodeproj; path = PostHogExampleWithSPM/PostHogExampleWithSPM.xcodeproj; sourceTree = ""; }; 690FF05E2AE7E2D400A0B06B /* Data+Gzip.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Gzip.swift"; sourceTree = ""; }; 690FF0AE2AEB9C1400A0B06B /* DateUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateUtils.swift; sourceTree = ""; }; @@ -1734,7 +1726,6 @@ DA8D37242CBEAC02005EBD27 /* PostHogExampleAutocapture.xcodeproj */, 690FF1732AF3CE8A00A0B06B /* PostHogExampleWatchOS.xcodeproj */, 690FF0532AE7DB3700A0B06B /* PostHogExampleWithSPM.xcodeproj */, - 690FF02F2AE7C5BA00A0B06B /* PostHogExampleWithPods.xcodeproj */, 3AAFB13129C0C699004F485B /* Package.swift */, 3AC745B7296D6FE60025C109 /* PostHog */, 3AC745C3296D6FE60025C109 /* PostHogTests */, @@ -1933,14 +1924,6 @@ path = PostHogTests; sourceTree = ""; }; - 690FF0302AE7C5BA00A0B06B /* Products */ = { - isa = PBXGroup; - children = ( - 690FF0342AE7C5BB00A0B06B /* PostHogExampleWithPods.app */, - ); - name = Products; - sourceTree = ""; - }; 690FF0542AE7DB3700A0B06B /* Products */ = { isa = PBXGroup; children = ( @@ -3197,10 +3180,6 @@ ProductGroup = 690FF1742AF3CE8A00A0B06B /* Products */; ProjectRef = 690FF1732AF3CE8A00A0B06B /* PostHogExampleWatchOS.xcodeproj */; }, - { - ProductGroup = 690FF0302AE7C5BA00A0B06B /* Products */; - ProjectRef = 690FF02F2AE7C5BA00A0B06B /* PostHogExampleWithPods.xcodeproj */; - }, { ProductGroup = 690FF0542AE7DB3700A0B06B /* Products */; ProjectRef = 690FF0532AE7DB3700A0B06B /* PostHogExampleWithSPM.xcodeproj */; @@ -3222,13 +3201,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 690FF0342AE7C5BB00A0B06B /* PostHogExampleWithPods.app */ = { - isa = PBXReferenceProxy; - fileType = wrapper.application; - path = PostHogExampleWithPods.app; - remoteRef = 690FF0332AE7C5BB00A0B06B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 690FF0582AE7DB3700A0B06B /* PostHogExampleWithSPM.app */ = { isa = PBXReferenceProxy; fileType = wrapper.application; diff --git a/PostHog.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme b/PostHog.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme deleted file mode 100644 index 4319ff1b52..0000000000 --- a/PostHog.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PostHog/PostHogVersion.swift b/PostHog/PostHogVersion.swift index 9d7d5940b6..c870f92462 100644 --- a/PostHog/PostHogVersion.swift +++ b/PostHog/PostHogVersion.swift @@ -7,7 +7,7 @@ import Foundation -// if you change this, make sure to also change it in the podspec and check if the script scripts/bump-version.sh still works +// if you change this, check if the script scripts/bump-version.sh still works /// Current SDK version string. /// /// - Warning: This is intended for SDK internals and integrations. Application code should not mutate it. diff --git a/PostHogExampleWithPods/Podfile b/PostHogExampleWithPods/Podfile deleted file mode 100644 index d080eb36f2..0000000000 --- a/PostHogExampleWithPods/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -platform :ios, '16.0' - -linkage = ENV['USE_FRAMEWORKS'] -if linkage != nil - Pod::UI.puts "Configuring Pod as #{linkage}ally linked Frameworks".green - use_frameworks! :linkage => linkage.to_sym -else - Pod::UI.puts "Configuring Pod as static library".green -end - -target 'PostHogExampleWithPods' do - pod 'PostHog', :git => '../' -end diff --git a/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/project.pbxproj b/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/project.pbxproj deleted file mode 100644 index 4991a997dd..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/project.pbxproj +++ /dev/null @@ -1,427 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 56; - objects = { - -/* Begin PBXBuildFile section */ - 690FF0222AE7C5B900A0B06B /* PostHogExampleWithPodsApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690FF0212AE7C5B900A0B06B /* PostHogExampleWithPodsApp.swift */; }; - 690FF0242AE7C5B900A0B06B /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690FF0232AE7C5B900A0B06B /* ContentView.swift */; }; - 690FF0262AE7C5BA00A0B06B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 690FF0252AE7C5BA00A0B06B /* Assets.xcassets */; }; - 690FF0292AE7C5BA00A0B06B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 690FF0282AE7C5BA00A0B06B /* Preview Assets.xcassets */; }; - 690FF0362AE7C61300A0B06B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 690FF0352AE7C61300A0B06B /* AppDelegate.swift */; }; - E7087D98D8DE0D2DD84278DD /* Pods_PostHogExampleWithPods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8266354C5603FEBCC7C01E4B /* Pods_PostHogExampleWithPods.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 4C2D1D1AA0327AA47D050EED /* Pods-PostHogExampleWithPods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PostHogExampleWithPods.release.xcconfig"; path = "Target Support Files/Pods-PostHogExampleWithPods/Pods-PostHogExampleWithPods.release.xcconfig"; sourceTree = ""; }; - 690FF01E2AE7C5B900A0B06B /* PostHogExampleWithPods.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PostHogExampleWithPods.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 690FF0212AE7C5B900A0B06B /* PostHogExampleWithPodsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogExampleWithPodsApp.swift; sourceTree = ""; }; - 690FF0232AE7C5B900A0B06B /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; - 690FF0252AE7C5BA00A0B06B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 690FF0282AE7C5BA00A0B06B /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; - 690FF0352AE7C61300A0B06B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 8266354C5603FEBCC7C01E4B /* Pods_PostHogExampleWithPods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PostHogExampleWithPods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9E7CD1F6231834F08BF61E6C /* Pods-PostHogExampleWithPods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PostHogExampleWithPods.debug.xcconfig"; path = "Target Support Files/Pods-PostHogExampleWithPods/Pods-PostHogExampleWithPods.debug.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 690FF01B2AE7C5B900A0B06B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E7087D98D8DE0D2DD84278DD /* Pods_PostHogExampleWithPods.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 40EAAE95CA89DD225C1A62CA /* Pods */ = { - isa = PBXGroup; - children = ( - 9E7CD1F6231834F08BF61E6C /* Pods-PostHogExampleWithPods.debug.xcconfig */, - 4C2D1D1AA0327AA47D050EED /* Pods-PostHogExampleWithPods.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - 690FF0152AE7C5B900A0B06B = { - isa = PBXGroup; - children = ( - 690FF0202AE7C5B900A0B06B /* PostHogExampleWithPods */, - 690FF01F2AE7C5B900A0B06B /* Products */, - 40EAAE95CA89DD225C1A62CA /* Pods */, - 9A20B85D4D10AA6F7B0C13FB /* Frameworks */, - ); - sourceTree = ""; - }; - 690FF01F2AE7C5B900A0B06B /* Products */ = { - isa = PBXGroup; - children = ( - 690FF01E2AE7C5B900A0B06B /* PostHogExampleWithPods.app */, - ); - name = Products; - sourceTree = ""; - }; - 690FF0202AE7C5B900A0B06B /* PostHogExampleWithPods */ = { - isa = PBXGroup; - children = ( - 690FF0352AE7C61300A0B06B /* AppDelegate.swift */, - 690FF0212AE7C5B900A0B06B /* PostHogExampleWithPodsApp.swift */, - 690FF0232AE7C5B900A0B06B /* ContentView.swift */, - 690FF0252AE7C5BA00A0B06B /* Assets.xcassets */, - 690FF0272AE7C5BA00A0B06B /* Preview Content */, - ); - path = PostHogExampleWithPods; - sourceTree = ""; - }; - 690FF0272AE7C5BA00A0B06B /* Preview Content */ = { - isa = PBXGroup; - children = ( - 690FF0282AE7C5BA00A0B06B /* Preview Assets.xcassets */, - ); - path = "Preview Content"; - sourceTree = ""; - }; - 9A20B85D4D10AA6F7B0C13FB /* Frameworks */ = { - isa = PBXGroup; - children = ( - 8266354C5603FEBCC7C01E4B /* Pods_PostHogExampleWithPods.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 690FF01D2AE7C5B900A0B06B /* PostHogExampleWithPods */ = { - isa = PBXNativeTarget; - buildConfigurationList = 690FF02C2AE7C5BA00A0B06B /* Build configuration list for PBXNativeTarget "PostHogExampleWithPods" */; - buildPhases = ( - ACA09137F648E598E95E500F /* [CP] Check Pods Manifest.lock */, - 690FF01A2AE7C5B900A0B06B /* Sources */, - 690FF01B2AE7C5B900A0B06B /* Frameworks */, - 690FF01C2AE7C5B900A0B06B /* Resources */, - 6E4C2BEF8CB8F259A129729E /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PostHogExampleWithPods; - productName = PostHogExampleWithPods; - productReference = 690FF01E2AE7C5B900A0B06B /* PostHogExampleWithPods.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 690FF0162AE7C5B900A0B06B /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1500; - LastUpgradeCheck = 1500; - TargetAttributes = { - 690FF01D2AE7C5B900A0B06B = { - CreatedOnToolsVersion = 15.0.1; - }; - }; - }; - buildConfigurationList = 690FF0192AE7C5B900A0B06B /* Build configuration list for PBXProject "PostHogExampleWithPods" */; - compatibilityVersion = "Xcode 14.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 690FF0152AE7C5B900A0B06B; - productRefGroup = 690FF01F2AE7C5B900A0B06B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 690FF01D2AE7C5B900A0B06B /* PostHogExampleWithPods */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 690FF01C2AE7C5B900A0B06B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 690FF0292AE7C5BA00A0B06B /* Preview Assets.xcassets in Resources */, - 690FF0262AE7C5BA00A0B06B /* Assets.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 6E4C2BEF8CB8F259A129729E /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PostHogExampleWithPods/Pods-PostHogExampleWithPods-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-PostHogExampleWithPods/Pods-PostHogExampleWithPods-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PostHogExampleWithPods/Pods-PostHogExampleWithPods-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - ACA09137F648E598E95E500F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-PostHogExampleWithPods-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 690FF01A2AE7C5B900A0B06B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 690FF0362AE7C61300A0B06B /* AppDelegate.swift in Sources */, - 690FF0242AE7C5B900A0B06B /* ContentView.swift in Sources */, - 690FF0222AE7C5B900A0B06B /* PostHogExampleWithPodsApp.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 690FF02A2AE7C5BA00A0B06B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 690FF02B2AE7C5BA00A0B06B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = NO; - GCC_C_LANGUAGE_STANDARD = gnu17; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 17.0; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 690FF02D2AE7C5BA00A0B06B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9E7CD1F6231834F08BF61E6C /* Pods-PostHogExampleWithPods.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"PostHogExampleWithPods/Preview Content\""; - DEVELOPMENT_TEAM = PNC2XCH2XP; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.posthog.PostHogExampleWithPods; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 690FF02E2AE7C5BA00A0B06B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4C2D1D1AA0327AA47D050EED /* Pods-PostHogExampleWithPods.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_IDENTITY = ""; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_ASSET_PATHS = "\"PostHogExampleWithPods/Preview Content\""; - DEVELOPMENT_TEAM = PNC2XCH2XP; - ENABLE_PREVIEWS = YES; - GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; - INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchScreen_Generation = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 16.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.posthog.PostHogExampleWithPods; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 690FF0192AE7C5B900A0B06B /* Build configuration list for PBXProject "PostHogExampleWithPods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 690FF02A2AE7C5BA00A0B06B /* Debug */, - 690FF02B2AE7C5BA00A0B06B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 690FF02C2AE7C5BA00A0B06B /* Build configuration list for PBXNativeTarget "PostHogExampleWithPods" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 690FF02D2AE7C5BA00A0B06B /* Debug */, - 690FF02E2AE7C5BA00A0B06B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 690FF0162AE7C5B900A0B06B /* Project object */; -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme b/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme deleted file mode 100644 index 411e04f114..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods.xcodeproj/xcshareddata/xcschemes/PostHogExampleWithPods.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/AppDelegate.swift b/PostHogExampleWithPods/PostHogExampleWithPods/AppDelegate.swift deleted file mode 100644 index f0aa976db7..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/AppDelegate.swift +++ /dev/null @@ -1,32 +0,0 @@ -// -// AppDelegate.swift -// PostHogExampleWithPods -// -// Created by Manoel Aranda Neto on 24.10.23. -// - -import Foundation -import PostHog -import UIKit - -class AppDelegate: NSObject, UIApplicationDelegate { - func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { - PostHogSDK.shared.onFeatureFlags { [weak self] _ in - self?.receiveFeatureFlags() - } - - let config = PostHogConfig( - projectToken: "phc_QFbR1y41s5sxnNTZoyKG2NJo2RlsCIWkUfdpawgb40D" - ) - - PostHogSDK.shared.setup(config) - PostHogSDK.shared.debug() - PostHogSDK.shared.capture("Event from CocoaPods example!") - - return true - } - - func receiveFeatureFlags() { - print("receiveFeatureFlags") - } -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AccentColor.colorset/Contents.json b/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AccentColor.colorset/Contents.json deleted file mode 100644 index eb87897008..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AccentColor.colorset/Contents.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AppIcon.appiconset/Contents.json b/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 13613e3ee1..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/Contents.json b/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a7..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/ContentView.swift b/PostHogExampleWithPods/PostHogExampleWithPods/ContentView.swift deleted file mode 100644 index 3ae9c1062a..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/ContentView.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// ContentView.swift -// PostHogExampleWithPods -// -// Created by Manoel Aranda Neto on 24.10.23. -// - -import SwiftUI - -struct ContentView: View { - var body: some View { - VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") - } - .padding() - } -} - -#Preview { - ContentView() -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/PostHogExampleWithPodsApp.swift b/PostHogExampleWithPods/PostHogExampleWithPods/PostHogExampleWithPodsApp.swift deleted file mode 100644 index 45d3027305..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/PostHogExampleWithPodsApp.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// PostHogExampleWithPodsApp.swift -// PostHogExampleWithPods -// -// Created by Manoel Aranda Neto on 24.10.23. -// - -import SwiftUI - -@main -struct PostHogExampleWithPodsApp: App { - @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate - - var body: some Scene { - WindowGroup { - ContentView() - } - } -} diff --git a/PostHogExampleWithPods/PostHogExampleWithPods/Preview Content/Preview Assets.xcassets/Contents.json b/PostHogExampleWithPods/PostHogExampleWithPods/Preview Content/Preview Assets.xcassets/Contents.json deleted file mode 100644 index 73c00596a7..0000000000 --- a/PostHogExampleWithPods/PostHogExampleWithPods/Preview Content/Preview Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/PostHogExampleWithPods/README.md b/PostHogExampleWithPods/README.md deleted file mode 100644 index af34b60b46..0000000000 --- a/PostHogExampleWithPods/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Example with CocoaPods - -This is an example of how to use the PostHog iOS SDK with CocoaPods. - -## Installation - -1. Install CocoaPods if you haven't already: - - - -```bash -sudo gem install cocoapods -``` - -## Add a Podfile to the project - - - -```text -platform :ios, '16.0' - -use_frameworks! - -target '$your_project' do - pod 'PostHog', '~> 3.0' -end -``` - -Replace `$your_project` to your project name. - -## Run `pod install` - -```bash -pod install -``` - -## Open the project - -Always open the `*.xcworkspace` file, not the `*.xcodeproj` file. diff --git a/README.md b/README.md index 2be037b204..55696d4d10 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ [![Build](https://img.shields.io/github/actions/workflow/status/PostHog/posthog-ios/build.yml?branch=main)](https://github.com/PostHog/posthog-ios/actions/workflows/build.yml?query=branch%3Amain) -[![CocoaPods compadible](https://img.shields.io/cocoapods/v/PostHog.svg)](https://cocoapods.org/pods/PostHog) [![SwiftPM compatible](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager) -![platforms](https://img.shields.io/cocoapods/p/PostHog.svg?style=flat) +[![Swift Package Index platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FPostHog%2Fposthog-ios%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/PostHog/posthog-ios) [![Swift Package Index](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FPostHog%2Fposthog-ios%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/PostHog/posthog-ios) # PostHog iOS @@ -10,6 +9,24 @@ Please see the main [PostHog docs](https://posthog.com/docs). Specifically, the [iOS docs](https://posthog.com/docs/libraries/ios) details. +## Installation + +Install PostHog with [Swift Package Manager](https://www.swift.org/documentation/package-manager/). In Xcode, choose **File > Add Package Dependencies…** and enter `https://github.com/PostHog/posthog-ios`, or add it to your `Package.swift`: + +```swift +dependencies: [ + .package(url: "https://github.com/PostHog/posthog-ios.git", from: "4.0.0") +] +``` + +### Moving from CocoaPods + +PostHog 4.0 and later is only published to Swift Package Manager. Versions 3.x stay on CocoaPods, but no new versions will be pushed there: [CocoaPods trunk becomes read-only on December 2, 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/). + +To move an app from CocoaPods, remove `pod 'PostHog'` from your `Podfile`, run `pod install`, then add the package as shown above. + +React Native and Flutter apps get this SDK through their PostHog package; follow that package's installation docs instead. + ## Questions? ### [Check out our community page.](https://posthog.com/posts) diff --git a/RELEASING.md b/RELEASING.md index a8652804f9..61b3532d12 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -30,12 +30,12 @@ When the PR is merged to `main`, the release workflow will automatically: 2. Notify the client libraries team in Slack for approval 3. Wait for approval from a maintainer (via GitHub environment protection) 4. Once approved: - - Apply changesets and bump the version (in `package.json`, `PostHogVersion.swift`, and `PostHog.podspec`) + - Apply changesets and bump the version (in `package.json` and `PostHogVersion.swift`) - Update the `CHANGELOG.md` - Commit the version bump to `main` - Create a git tag and GitHub release - - Publish the pod to CocoaPods - - SPM uses the tag name to determine the version, directly from the repo + +Swift Package Manager reads the version from the git tag, so the tag is the release. 4.x is distributed only through Swift Package Manager; see [CocoaPods](#cocoapods). ### Manual Trigger @@ -74,134 +74,12 @@ If the release workflow fails with "No changesets found", ensure your PR include Make sure the PR includes a changeset file and was merged to `main`, or trigger the workflow manually from the Actions tab. -### Manual CocoaPods publish (emergency only) - -In case of automation failure, you can manually publish: - -```bash -make releaseCocoaPods -``` - -You'll need to be authenticated with CocoaPods trunk and have push access to the `PostHog` pod. - -# CocoaPods Management - -The PostHog iOS SDK is published to CocoaPods automatically via GitHub Actions when a release is created. This section covers the management of CocoaPods permissions and tokens. - -### Check Your Current Session - -```bash -# Check if you're logged in and your permissions -pod trunk me -``` - -Expected output should show: - -```text -- Name: Your Name -- Email: your.email@posthog.com -- Since: Date -- Pods: - - PostHog -- Sessions: - - Session details... -``` - -### Check Pod Ownership - -```bash -# Check who owns the PostHog pod -pod trunk info PostHog -``` - -This will show: - -- Current version -- All owners with push permissions - -### Adding a co-owner +## CocoaPods -1. **With an existing owner**: +PostHog 4.0 and later is not published to CocoaPods. The release workflow has no CocoaPods step, and the repository no longer has a podspec or a `make releaseCocoaPods` target. - ```bash - # Run this as an existing owner - pod trunk add-owner PostHog dev.email@posthog.com - ``` +[CocoaPods trunk becomes read-only on December 2, 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/). After that date nobody can push a new version of the `PostHog` pod: -2. **Verify**: - ```bash - # Check that the new owner was added - pod trunk info PostHog - ``` - -### Removing a co-owner - -1. **With an existing owner**: - - ```bash - # Run this as an existing owner - pod trunk remove-owner PostHog dev.email@posthog.com - ``` - -2. **Verify**: - ```bash - # Check that the new owner was removed - pod trunk info PostHog - ``` - -### Rotating COCOAPODS_TRUNK_TOKEN - -The `COCOAPODS_TRUNK_TOKEN` is used in GitHub Actions for automated releases. Here's how to rotate it: - -The token is stored as a GitHub secret and used in `.github/workflows/release.yml`: - -```yaml -env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} -``` - -#### Step 1: Create a new session - -1. **Login to CocoaPods Trunk** - As the account that will own the token, create a new session with: - ```bash - pod trunk register your.email@posthog.com 'Your Name' - # Verify email if needed - ``` - -2. **Extract the token**: - The token is stored in `~/.netrc` file: - ```bash - # View your .netrc file - grep -A2 'trunk.cocoapods.org' ~/.netrc - # or look for the line with `trunk.cocoapods.org` in ~/.netrc - cat ~/.netrc - ``` - -#### Step 2: Update GitHub Secret - -1. **Go to GitHub repository settings**: - - Request temp access if needed - - Navigate to `https://github.com/organizations/PostHog/settings/secrets/actions` - - Or: Org → Settings → Secrets and variables → Actions - -2. **Update the secret**: - - Find `COCOAPODS_TRUNK_TOKEN` in the list - - Update the secret - -#### Step 3: Revoking Old Sessions - -1. **Revoke old sessions**: - ```bash - # Clear current sessions (from the user that owned the previous token) - pod trunk me clean-sessions - ``` - -#### Step 4: Update workflow docs - -Update `./.github/workflows/release.yml` with a comment on the new token owner. - -```yaml -env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} # Using @username token -``` +- 3.x versions already on trunk stay installable with `pod 'PostHog', '~> 3.0'`, but they are frozen. No new 3.x pod can be published after the lock. +- Before the lock, a 3.x fix can only reach CocoaPods from a branch cut from the latest 3.x tag, because the release workflow runs on `main`, which is 4.x. That branch still has `PostHog.podspec`, `make releaseCocoaPods` and the pod-ownership and `COCOAPODS_TRUNK_TOKEN` docs (see [RELEASING.md at 3.92.5](https://github.com/PostHog/posthog-ios/blob/3.92.5/RELEASING.md#cocoapods-management)). Get maintainer approval before publishing from it. +- Once no further 3.x pod is planned, and at the latest after the lock, delete the `COCOAPODS_TRUNK_TOKEN` secret and revoke its trunk session with `pod trunk me clean-sessions`. diff --git a/build-tools/upload-symbols.sh b/build-tools/upload-symbols.sh index 449c6b1e0f..ca4ae016b6 100755 --- a/build-tools/upload-symbols.sh +++ b/build-tools/upload-symbols.sh @@ -5,14 +5,13 @@ # # Xcode Build Phase Setup: # SPM: "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh" -# CocoaPods: "${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh" # # # Usage Examples: -# Basic: "${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh" -# With source: POSTHOG_INCLUDE_SOURCE=1 "${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh" -# Skip conflicts: POSTHOG_SKIP_ON_CONFLICT=1 "${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh" -# Overwrite: POSTHOG_FORCE=1 "${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh" +# Basic: "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh" +# With source: POSTHOG_INCLUDE_SOURCE=1 "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh" +# Skip conflicts: POSTHOG_SKIP_ON_CONFLICT=1 "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh" +# Overwrite: POSTHOG_FORCE=1 "${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh" # # Build Settings (required): # DEBUG_INFORMATION_FORMAT = DWARF with dSYM File diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index 7ef882a815..8471e45895 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -12,6 +12,3 @@ NEW_VERSION="$1" # Replace `postHogVersion` with the given version perl -pi -e "s/postHogVersion = \".*\"/postHogVersion = \"$NEW_VERSION\"/" PostHog/PostHogVersion.swift - -# Replace `s.version` with the given version -perl -pi -e "s/s.version = \".*\"/s.version = \"$NEW_VERSION\"/" PostHog.podspec