---
title: "github.com/posthog/posthog-ios 4.0.0 Breaking Changes"
description: "What each github.com/posthog/posthog-ios release removed, renamed or changed: 79 breaking changes in 1 version on Swift Package Index, each with its source."
canonical_url: https://since.dev/packages/swift/github.com/posthog/posthog-ios
last_updated: 2026-12-04
---

# github.com/posthog/posthog-ios breaking changes

github.com/posthog/posthog-ios 4.0.0 (November 20, 2026) is its newest release with breaking changes, 79 of them. The first: Events queued by 2.x.x SDK are deleted when upgrading straight to 4.x.x in github.com/PostHog/posthog-ios 4.0.0. Every breaking API change we have recorded in github.com/posthog/posthog-ios on Swift Package Index: 79 breaking changes in 1 version. Below, its one version with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `4.2.9`, released December 4, 2026. [Source repository](https://github.com/PostHog/posthog-ios)

## github.com/posthog/posthog-ios 4.0.0 breaking changes

github.com/posthog/posthog-ios 4.0.0, released November 20, 2026: 79 breaking changes.

- **Removed**  

Events still queued on disk by a 2.x.x SDK are deleted instead of sent when an app upgrades straight to 4.x.x. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed**  

The SDK now needs Xcode 26 or later and higher deployment targets, and is installable only with Swift Package Manager. Move your app to Swift Package Manager and raise your deployment targets. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed**  

Install with Swift Package Manager. Version 3.x.x stays on CocoaPods. [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `Application Installed`  

Removes version and build from app lifecycle events in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `config.propertiesSanitizer`  

Replace the properties sanitizer with a beforeSend block that edits or drops the event. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `config.remoteConfig`  

Remote config is always loaded, so delete the assignment to config.remoteConfig. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `config.sessionReplay`  

With the SessionReplay trait off, config.sessionReplay, startSessionRecording and related APIs are removed. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `config.storageManager`  

Use identify, getDistinctId, getAnonymousId, getDeviceId and reset on PostHogSDK instead of a storage manager. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `getFeatureFlagPayload`  

Read payloads from getFeatureFlagResult(key, sendFeatureFlagEvent: false)?.payload instead. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `Gzip`  

Removes Gzip from public API in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogConfig`  

Removes apiKey initializer in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogConfig.apiKey`  

Removes PostHogConfig.apiKey in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogConfig.evaluationEnvironments`  

Removes evaluationEnvironments in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogConfig.propertiesSanitizer`  

Removes propertiesSanitizer in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogConfig.remoteConfig`  

Removes no-op remoteConfig option in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogDataMode`  

Constructing PostHogDataMode from raw value 1 returns nil instead of a case. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `PostHogDataMode.cellular`  

Removes PostHogDataMode.cellular in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogPropertiesSanitizer`  

Removes PostHogPropertiesSanitizer in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogSDK.didReceiveFeatureFlags`  

Subscribe with onFeatureFlags(\_:) instead of observing the notification. [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogSDK.getFeatureFlagPayload`  

Removes getFeatureFlagPayload in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `postHogSdkName`  

Moves postHogSdkName out of public API in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogSessionManager`  

Session manager and internal utilities are no longer public. Use getSessionId, startSession and endSession on PostHogSDK. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `PostHogSessionReplayConfig.debouncerDelay`  

Removes debouncerDelay in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogSessionReplayConfig.maskPhotoLibraryImages`  

Removes no-op maskPhotoLibraryImages option in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `PostHogSessionReplayConfig.screenshotModeBackgroundCapture`  

Removes background screenshot capture in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `postHogVersion`  

Moves postHogVersion out of public API in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `ReachabilityError`  

Use NWPathMonitor if your app needs reachability. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `sessionReplayConfig.screenshotMode`  

Delete the screenshotMode assignment, since replay always records masked screenshots. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `sessionReplayConfig.screenshotModeBackgroundCapture`  

Background capture is removed. Use captureMethod set to .gpu if standard capture costs too much main-thread time. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Removed** `toISO8601Date`  

Removes toISO8601Date in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `toISO8601String`  

Removes toISO8601String in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Removed** `UIColor.init`  

Removes UIColor hex initializer in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Renamed** `config.apiKey`  

The apiKey property is renamed to projectToken on the config object. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Renamed** `config.dataMode`  

The cellular data mode is renamed to any. Objective-C users switch to PostHogDataModeAny. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Renamed** `config.evaluationEnvironments`  

The evaluationEnvironments property is renamed to evaluationContexts. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Renamed** `config.maxRetries`  

The maxRetries property was renamed and only ever limited push-notification subscription retries. Use the new property name. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Renamed** `PostHogConfig`  

The apiKey initializer label is renamed to projectToken. Update every initializer call. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Renamed** `PostHogLogEntry`  

Renames PostHogLogEntry in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Renamed** `PostHogLogLevel`  

The log level type is renamed to PostHogConsoleLogLevel, and PostHogLogEntry is renamed to PostHogConsoleLogEntry. [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Renamed** `PostHogSessionReplayConfig.screenshotModeGPUCapture`  

Replaces screenshotModeGPUCapture with captureMethod in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Renamed** `sessionReplayConfig.debouncerDelay`  

The debouncerDelay setting is renamed to throttleDelay. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Behavior changed**  

Redirect handling restricted in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Behavior changed**  

PostHog drops events whose name is over 200 UTF-8 bytes, where legacy capture had no limit. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Behavior changed**  

Events with long distinct IDs are dropped in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Behavior changed**  

Malformed feature flag payloads return nil in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Behavior changed**  

404 capture responses retried and kept queued in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)
- **Behavior changed**  

The SDK follows 307 or 308 redirects only to the origin of host. Any other redirect is not followed and events are dropped, so point host at the final host. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Behavior changed**  

Events are sent to /i/v1/analytics/events instead of /batch. Self-hosted instances and reverse proxies must serve and forward the new routes. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Behavior changed**  

PostHog drops events whose distinct ID is over 200 UTF-8 bytes, where legacy capture shortened it. Shorten or hash long IDs before upgrading. [github.com](https://github.com/PostHog/posthog-ios/blob/main/MIGRATION.md)
- **Behavior changed**  

SDK disabled when given a personal API key in github.com/PostHog/posthog-ios 4.0.0 [github.com](https://github.com/PostHog/posthog-ios/releases/tag/4.0.0)

And 29 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
