From 0ba9135d835f2e079bbe0411987608d52e0a9e2c Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Fri, 2 Oct 2026 19:02:45 -0400 Subject: [PATCH 1/7] chore!: adopt posthog-ios 4.0 and remove deprecated APIs for v6 - Require posthog-ios 4.x (iOS 15 minimum, Xcode 26). - Remove PostHogConfig.apiKey and the API_KEY manifest/Info.plist fallback. - Remove getFeatureFlagPayload() across Dart, web and native handlers. - Remove the debouncerDelay setter and PostHogDataMode.cellular. Co-Authored-By: Claude Opus 5.5 (1M context) --- .changeset/v6-posthog-ios-4.md | 9 ++ .github/workflows/codeql.yml | 4 +- api/posthog_flutter.api.json | 99 ------------------- example/ios/Podfile | 2 +- example/ios/Podfile.lock | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 18 ++-- .../posthog/flutter/PosthogFlutterPlugin.kt | 47 +-------- .../darwin/posthog_flutter.podspec | 5 +- .../darwin/posthog_flutter/Package.swift | 4 +- .../PosthogFlutterPlugin.swift | 48 ++------- posthog_flutter/lib/posthog_flutter_web.dart | 7 -- posthog_flutter/lib/src/posthog.dart | 10 -- posthog_flutter/lib/src/posthog_config.dart | 31 ------ .../lib/src/posthog_flutter_io.dart | 16 --- .../posthog_flutter_platform_interface.dart | 6 -- .../lib/src/posthog_flutter_web_handler.dart | 6 -- .../test/posthog_flutter_io_test.dart | 4 +- ...sthog_flutter_platform_interface_fake.dart | 6 -- posthog_flutter/test/posthog_test.dart | 2 - .../test/snapshots/setup_request.json | 1 - 20 files changed, 42 insertions(+), 285 deletions(-) create mode 100644 .changeset/v6-posthog-ios-4.md diff --git a/.changeset/v6-posthog-ios-4.md b/.changeset/v6-posthog-ios-4.md new file mode 100644 index 00000000..a6c1f81b --- /dev/null +++ b/.changeset/v6-posthog-ios-4.md @@ -0,0 +1,9 @@ +--- +"posthog_flutter": major +--- + +- **Breaking:** bump minimum iOS deployment target from 13.0 to 15.0 and require Xcode 26, adopting `posthog-ios` 4.x +- **Breaking:** remove `PostHogConfig.apiKey` and the `com.posthog.posthog.API_KEY` manifest/Info.plist key — use `projectToken` and `com.posthog.posthog.PROJECT_TOKEN` +- **Breaking:** remove `Posthog().getFeatureFlagPayload()` — use `getFeatureFlagResult(key, sendEvent: false)` and read `payload` +- **Breaking:** remove the `PostHogSessionReplayConfig.debouncerDelay` setter — use `PostHogSessionReplayConfig.throttleDelay` +- **Breaking:** remove `PostHogDataMode.cellular` — use `PostHogDataMode.any`, which it always behaved like diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f88a2503..84257df9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: runner: ubuntu-latest - language: swift build-mode: manual - runner: macos-15-xlarge + runner: macos-26 - language: actions build-mode: none runner: ubuntu-latest @@ -45,7 +45,7 @@ jobs: if: matrix.language == 'swift' uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0 with: - xcode-version: '16.4' + xcode-version: '26.4' - name: Install dependencies (Swift) if: matrix.language == 'swift' diff --git a/api/posthog_flutter.api.json b/api/posthog_flutter.api.json index 33cae6ee..b07cfe8f 100644 --- a/api/posthog_flutter.api.json +++ b/api/posthog_flutter.api.json @@ -876,28 +876,6 @@ "type": "method", "typeParameterNames": [] }, - { - "entryPoints": [], - "isDeprecated": false, - "isExperimental": false, - "isStatic": false, - "name": "getFeatureFlagPayload", - "parameters": [ - { - "isDeprecated": false, - "isExperimental": false, - "isNamed": true, - "isRequired": true, - "name": "key", - "relativePath": "lib/src/posthog_flutter_platform_interface.dart", - "typeName": "String" - } - ], - "relativePath": "lib/src/posthog_flutter_platform_interface.dart", - "returnTypeName": "Future", - "type": "method", - "typeParameterNames": [] - }, { "entryPoints": [], "isDeprecated": false, @@ -1859,28 +1837,6 @@ "type": "method", "typeParameterNames": [] }, - { - "entryPoints": [], - "isDeprecated": false, - "isExperimental": false, - "isStatic": false, - "name": "getFeatureFlagPayload", - "parameters": [ - { - "isDeprecated": false, - "isExperimental": false, - "isNamed": true, - "isRequired": true, - "name": "key", - "relativePath": "lib/src/posthog_flutter_platform_interface.dart", - "typeName": "String" - } - ], - "relativePath": "lib/src/posthog_flutter_platform_interface.dart", - "returnTypeName": "Future", - "type": "method", - "typeParameterNames": [] - }, { "entryPoints": [], "isDeprecated": false, @@ -2173,17 +2129,6 @@ "relativePath": "lib/src/posthog_config.dart", "typeName": "String" }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isReadable": true, - "isStatic": false, - "isWriteable": false, - "name": "apiKey", - "relativePath": "lib/src/posthog_config.dart", - "typeName": "String" - }, { "entryPoints": [], "isDeprecated": false, @@ -2770,17 +2715,6 @@ "relativePath": "lib/src/posthog_config.dart", "typeName": "PostHogTextMask Function(String, Widget)?" }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isReadable": false, - "isStatic": false, - "isWriteable": true, - "name": "debouncerDelay", - "relativePath": "lib/src/posthog_config.dart", - "typeName": "Duration" - }, { "entryPoints": [], "isDeprecated": false, @@ -2950,17 +2884,6 @@ "relativePath": "lib/src/posthog_config.dart", "typeName": "PostHogDataMode" }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isReadable": true, - "isStatic": true, - "isWriteable": false, - "name": "cellular", - "relativePath": "lib/src/posthog_config.dart", - "typeName": "PostHogDataMode" - }, { "entryPoints": [], "isDeprecated": false, @@ -4826,28 +4749,6 @@ "type": "method", "typeParameterNames": [] }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isStatic": false, - "name": "getFeatureFlagPayload", - "parameters": [ - { - "isDeprecated": false, - "isExperimental": false, - "isNamed": false, - "isRequired": true, - "name": "key", - "relativePath": "lib/src/posthog.dart", - "typeName": "String" - } - ], - "relativePath": "lib/src/posthog.dart", - "returnTypeName": "Future", - "type": "method", - "typeParameterNames": [] - }, { "entryPoints": [], "isDeprecated": false, diff --git a/example/ios/Podfile b/example/ios/Podfile index 266a1cd0..e20ea2b7 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '14.0' +platform :ios, '15.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6356c2c8..70f8356f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -33,6 +33,6 @@ SPEC CHECKSUMS: google_maps_flutter_ios: 17552876e72723da1d41accc22f03b5f7afbde69 GoogleMaps: 8939898920281c649150e0af74aa291c60f2e77d -PODFILE CHECKSUM: 3c864ae2f1db9f17d3418f22aa4b78eac050c10b +PODFILE CHECKSUM: 583e7c5826ead1663c2849ec27bee3d398ceebac COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index b6975b16..535d541f 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -478,7 +478,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -497,7 +497,7 @@ DEVELOPMENT_TEAM = PNC2XCH2XP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -518,7 +518,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.example.posthogFlutterExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -537,7 +537,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.example.posthogFlutterExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -554,7 +554,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.example.posthogFlutterExample.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -610,7 +610,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -659,7 +659,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -680,7 +680,7 @@ DEVELOPMENT_TEAM = PNC2XCH2XP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -704,7 +704,7 @@ DEVELOPMENT_TEAM = PNC2XCH2XP; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/posthog_flutter/android/src/main/kotlin/com/posthog/flutter/PosthogFlutterPlugin.kt b/posthog_flutter/android/src/main/kotlin/com/posthog/flutter/PosthogFlutterPlugin.kt index 5474b8cd..378353bb 100644 --- a/posthog_flutter/android/src/main/kotlin/com/posthog/flutter/PosthogFlutterPlugin.kt +++ b/posthog_flutter/android/src/main/kotlin/com/posthog/flutter/PosthogFlutterPlugin.kt @@ -185,21 +185,10 @@ class PosthogFlutterPlugin : return } - val projectToken = - ( - bundle.getString("com.posthog.posthog.PROJECT_TOKEN") - ?: bundle.getString("com.posthog.posthog.API_KEY") - )?.trim() - - if (!bundle.containsKey("com.posthog.posthog.PROJECT_TOKEN") && bundle.containsKey("com.posthog.posthog.API_KEY")) { - Log.w( - "PostHog", - "com.posthog.posthog.API_KEY is deprecated and will be removed in the next major version. Use com.posthog.posthog.PROJECT_TOKEN instead!", - ) - } + val projectToken = bundle.getString("com.posthog.posthog.PROJECT_TOKEN")?.trim() if (projectToken.isNullOrEmpty()) { - Log.e("PostHog", "Either com.posthog.posthog.PROJECT_TOKEN or com.posthog.posthog.API_KEY must be provided!") + Log.e("PostHog", "com.posthog.posthog.PROJECT_TOKEN must be provided!") return } @@ -224,7 +213,6 @@ class PosthogFlutterPlugin : val posthogConfig = mutableMapOf() posthogConfig["projectToken"] = projectToken - posthogConfig["apiKey"] = projectToken posthogConfig["host"] = host posthogConfig["captureApplicationLifecycleEvents"] = captureApplicationLifecycleEvents posthogConfig["debug"] = debug @@ -322,10 +310,6 @@ class PosthogFlutterPlugin : getFeatureFlag(call, result) } - "getFeatureFlagPayload" -> { - getFeatureFlagPayload(call, result) - } - "getFeatureFlagResult" -> { getFeatureFlagResult(call, result) } @@ -552,19 +536,9 @@ class PosthogFlutterPlugin : } private fun setupPostHog(posthogConfig: Map) { - val projectToken = - ( - (posthogConfig["projectToken"] as String?) - ?: (posthogConfig["apiKey"] as String?) - )?.trim() - if (!posthogConfig.containsKey("projectToken") && posthogConfig.containsKey("apiKey")) { - Log.w( - "PostHog", - "apiKey is deprecated and will be removed in the next major version. Use projectToken instead!", - ) - } + val projectToken = (posthogConfig["projectToken"] as String?)?.trim() if (projectToken.isNullOrEmpty()) { - Log.e("PostHog", "Either projectToken or apiKey must be provided!") + Log.e("PostHog", "projectToken must be provided!") return } @@ -1670,19 +1644,6 @@ class PosthogFlutterPlugin : } } - private fun getFeatureFlagPayload( - call: MethodCall, - result: Result, - ) { - try { - val featureFlagKey: String = call.argument("key")!! - val flag = PostHog.getFeatureFlagResult(featureFlagKey, sendFeatureFlagEvent = false)?.payload - result.success(flag) - } catch (e: Throwable) { - result.error("PosthogFlutterException", e.localizedMessage, null) - } - } - private fun getFeatureFlagResult( call: MethodCall, result: Result, diff --git a/posthog_flutter/darwin/posthog_flutter.podspec b/posthog_flutter/darwin/posthog_flutter.podspec index c39b30b2..a22019d8 100644 --- a/posthog_flutter/darwin/posthog_flutter.podspec +++ b/posthog_flutter/darwin/posthog_flutter.podspec @@ -21,10 +21,9 @@ Postog flutter plugin s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' - # ~> Version 3.80.0 up to, but not including, 4.0.0 - s.dependency 'PostHog', '>= 3.84.0', '< 4.0.0' + s.dependency 'PostHog', '>= 4.0.0', '< 5.0.0' - s.ios.deployment_target = '13.0' + s.ios.deployment_target = '15.0' # PH iOS SDK 3.0.0 requires >= 10.15 s.osx.deployment_target = '10.15' diff --git a/posthog_flutter/darwin/posthog_flutter/Package.swift b/posthog_flutter/darwin/posthog_flutter/Package.swift index dd9a201d..4d02be7c 100644 --- a/posthog_flutter/darwin/posthog_flutter/Package.swift +++ b/posthog_flutter/darwin/posthog_flutter/Package.swift @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "posthog_flutter", platforms: [ - .iOS("13.0"), + .iOS("15.0"), .macOS("10.15"), ], products: [ @@ -14,7 +14,7 @@ let package = Package( ], dependencies: [ .package(name: "FlutterFramework", path: "../FlutterFramework"), - .package(url: "https://github.com/PostHog/posthog-ios", "3.84.0" ..< "4.0.0"), + .package(url: "https://github.com/PostHog/posthog-ios", "4.0.0" ..< "5.0.0"), ], targets: [ .target( diff --git a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift index f00c34e9..d6b7a77a 100644 --- a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift +++ b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift @@ -120,17 +120,11 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { return } - let projectToken = ((Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.PROJECT_TOKEN") as? String) ?? (Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.API_KEY") as? String) ?? "") + let projectToken = (Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.PROJECT_TOKEN") as? String ?? "") .trimmingCharacters(in: .whitespacesAndNewlines) - if Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.PROJECT_TOKEN") == nil, - Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.API_KEY") != nil - { - print("[PostHog] com.posthog.posthog.API_KEY is deprecated and will be removed in the next major version. Use com.posthog.posthog.PROJECT_TOKEN instead!") - } - if projectToken.isEmpty { - print("[PostHog] Either com.posthog.posthog.PROJECT_TOKEN or com.posthog.posthog.API_KEY must be provided!") + print("[PostHog] com.posthog.posthog.PROJECT_TOKEN must be provided!") return } @@ -144,7 +138,6 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { setupPostHog([ "projectToken": projectToken, - "apiKey": projectToken, "host": host, "captureApplicationLifecycleEvents": captureApplicationLifecycleEvents, "debug": debug, @@ -161,13 +154,10 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { print("[PostHog] Plugin instance not found!") return } - let projectToken = ((posthogConfig["projectToken"] as? String) ?? (posthogConfig["apiKey"] as? String) ?? "") + let projectToken = (posthogConfig["projectToken"] as? String ?? "") .trimmingCharacters(in: .whitespacesAndNewlines) - if posthogConfig["projectToken"] == nil, posthogConfig["apiKey"] != nil { - print("[PostHog] apiKey is deprecated and will be removed in the next major version. Use projectToken instead!") - } if projectToken.isEmpty { - print("[PostHog] Either projectToken or apiKey must be provided!") + print("[PostHog] projectToken must be provided!") return } @@ -235,7 +225,7 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { switch dataMode { case "wifi": config.dataMode = .wifi - case "any", "cellular": + case "any": config.dataMode = .any default: break @@ -290,13 +280,11 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { } // configure surveys - if #available(iOS 15.0, *) { - let surveys: Bool = posthogConfig["surveys"] as? Bool ?? false - config.surveys = surveys - if surveys { - // if surveys are enabled, assign this instance as the survey delegate (we'll take over rendering) - config.surveysConfig.surveysDelegate = instance - } + let surveys: Bool = posthogConfig["surveys"] as? Bool ?? false + config.surveys = surveys + if surveys { + // if surveys are enabled, assign this instance as the survey delegate (we'll take over rendering) + config.surveysConfig.surveysDelegate = instance } #endif @@ -457,8 +445,6 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { getFeatureFlag(call, result: result) case "isFeatureEnabled": isFeatureEnabled(call, result: result) - case "getFeatureFlagPayload": - getFeatureFlagPayload(call, result: result) case "getFeatureFlagResult": getFeatureFlagResult(call, result: result) case "identify": @@ -1352,20 +1338,6 @@ extension PosthogFlutterPlugin { } } - private func getFeatureFlagPayload( - _ call: FlutterMethodCall, - result: @escaping FlutterResult - ) { - if let args = call.arguments as? [String: Any], - let featureFlagKey = args["key"] as? String - { - let value = PostHogSDK.shared.getFeatureFlagResult(featureFlagKey, sendFeatureFlagEvent: false)?.payload - result(value) - } else { - _badArgumentError(result) - } - } - private func getFeatureFlagResult( _ call: FlutterMethodCall, result: @escaping FlutterResult diff --git a/posthog_flutter/lib/posthog_flutter_web.dart b/posthog_flutter/lib/posthog_flutter_web.dart index 1b6d2f44..0c718f0e 100644 --- a/posthog_flutter/lib/posthog_flutter_web.dart +++ b/posthog_flutter/lib/posthog_flutter_web.dart @@ -403,13 +403,6 @@ class PosthogFlutterWeb extends PosthogFlutterPlatformInterface { return handleWebMethodCall(MethodCall('getFeatureFlag', {'key': key})); } - @override - Future getFeatureFlagPayload({required String key}) async { - return handleWebMethodCall( - MethodCall('getFeatureFlagPayload', {'key': key}), - ); - } - @override Future getFeatureFlagResult({ required String key, diff --git a/posthog_flutter/lib/src/posthog.dart b/posthog_flutter/lib/src/posthog.dart index 8abd1018..e444c4bc 100644 --- a/posthog_flutter/lib/src/posthog.dart +++ b/posthog_flutter/lib/src/posthog.dart @@ -750,16 +750,6 @@ class Posthog { }) => _posthog.getFeatureFlagResult(key: key, sendEvent: sendEvent); - /// Returns the payload for the feature flag [key]. - /// - /// Returns `null` when the flag does not exist, has no payload, or the payload - /// cannot be loaded. - @Deprecated( - 'Use getFeatureFlagResult instead, which returns both value and payload.', - ) - Future getFeatureFlagPayload(String key) => - _posthog.getFeatureFlagPayload(key: key); - /// Flushes queued events immediately where supported by the platform. /// /// Returns a [Future] that completes when the flush request has finished. diff --git a/posthog_flutter/lib/src/posthog_config.dart b/posthog_flutter/lib/src/posthog_config.dart index 93284849..5bd9230b 100644 --- a/posthog_flutter/lib/src/posthog_config.dart +++ b/posthog_flutter/lib/src/posthog_config.dart @@ -72,17 +72,6 @@ enum PostHogDataMode { /// Send data only on Wi-Fi connections. wifi, - /// Send data on any available connection, same as [any]. - /// - /// Despite its name, this never restricted sending to cellular connections. - /// It will be removed in the next major version. - /// - /// ```dart - /// config.dataMode = PostHogDataMode.any; - /// ``` - @Deprecated('Behaves like `any`. Use `PostHogDataMode.any` instead.') - cellular, - /// Send data on any available connection. any, } @@ -98,16 +87,8 @@ class PostHogConfig { /// /// You can find it at: /// https://us.posthog.com/settings/project-details#variables - /// - /// This field was formerly named [apiKey]. final String projectToken; - /// Deprecated alias for [projectToken]. - @Deprecated( - 'Deprecated in favor of [projectToken]. This will be removed in the next major version.', - ) - String get apiKey => projectToken; - String _host = _defaultHost; /// The PostHog ingestion host. @@ -431,7 +412,6 @@ class PostHogConfig { Map toMap() { return { 'projectToken': projectToken, - 'apiKey': projectToken, 'host': host, 'flushAt': flushAt, 'maxQueueSize': maxQueueSize, @@ -865,17 +845,6 @@ class PostHogSessionReplayConfig { /// Default: null. PostHogTextMaskPolicy? textMaskPolicy; - /// Deprecated setter that forwards assigned values to [throttleDelay]. - /// - /// Debouncer delay used to reduce the number of snapshots captured and reduce - /// performance impact. This is used for capturing the view as a screenshot. - /// The lower the number, the more snapshots will be captured but higher the - /// performance impact. Defaults to 1s. - @Deprecated('Deprecated in favor of [throttleDelay] from v4.8.0.') - set debouncerDelay(Duration debouncerDelay) { - throttleDelay = debouncerDelay; - } - /// Throttling delay used to reduce the number of snapshots captured and reduce /// performance impact. /// diff --git a/posthog_flutter/lib/src/posthog_flutter_io.dart b/posthog_flutter/lib/src/posthog_flutter_io.dart index 6915f76c..50f0ba19 100644 --- a/posthog_flutter/lib/src/posthog_flutter_io.dart +++ b/posthog_flutter/lib/src/posthog_flutter_io.dart @@ -667,22 +667,6 @@ class PosthogFlutterIO extends PosthogFlutterPlatformInterface { } } - @override - Future getFeatureFlagPayload({required String key}) async { - if (!isSupportedPlatform()) { - return null; - } - - try { - return await _methodChannel.invokeMethod('getFeatureFlagPayload', { - 'key': key, - }); - } on PlatformException catch (exception) { - printIfDebug('Exeption on getFeatureFlagPayload: $exception'); - return null; - } - } - @override Future getFeatureFlagResult({ required String key, diff --git a/posthog_flutter/lib/src/posthog_flutter_platform_interface.dart b/posthog_flutter/lib/src/posthog_flutter_platform_interface.dart index ee37df82..4c865355 100644 --- a/posthog_flutter/lib/src/posthog_flutter_platform_interface.dart +++ b/posthog_flutter/lib/src/posthog_flutter_platform_interface.dart @@ -204,12 +204,6 @@ abstract class PosthogFlutterPlatformInterface extends PlatformInterface { throw UnimplementedError('getFeatureFlag() has not been implemented.'); } - Future getFeatureFlagPayload({required String key}) { - throw UnimplementedError( - 'getFeatureFlagPayload() has not been implemented.', - ); - } - Future getFeatureFlagResult({ required String key, bool sendEvent = true, diff --git a/posthog_flutter/lib/src/posthog_flutter_web_handler.dart b/posthog_flutter/lib/src/posthog_flutter_web_handler.dart index 211a8dca..7f0b5406 100644 --- a/posthog_flutter/lib/src/posthog_flutter_web_handler.dart +++ b/posthog_flutter/lib/src/posthog_flutter_web_handler.dart @@ -57,7 +57,6 @@ extension PostHogExtension on PostHog { // ignore: non_constant_identifier_names external bool has_opted_out_capturing(); external JSAny? getFeatureFlag(JSAny key); - external JSAny? getFeatureFlagPayload(JSAny key); external JSAny? getFeatureFlagResult(JSAny key, [JSAny? options]); external void register(JSAny properties); external void unregister(JSAny key); @@ -367,11 +366,6 @@ Future handleWebMethodCall(MethodCall call) async { final featureFlag = posthog?.getFeatureFlag(stringToJSAny(key)); return featureFlag?.dartify(); - case 'getFeatureFlagPayload': - final key = args['key'] as String; - - final featureFlag = posthog?.getFeatureFlagPayload(stringToJSAny(key)); - return featureFlag?.dartify(); case 'getFeatureFlagResult': final key = args['key'] as String; final sendEvent = args['sendEvent'] as bool? ?? true; diff --git a/posthog_flutter/test/posthog_flutter_io_test.dart b/posthog_flutter/test/posthog_flutter_io_test.dart index af13ba0e..f243ada8 100644 --- a/posthog_flutter/test/posthog_flutter_io_test.dart +++ b/posthog_flutter/test/posthog_flutter_io_test.dart @@ -111,14 +111,14 @@ void main() { }, ); - test('setup sends projectToken and deprecated apiKey alias', () async { + test('setup sends projectToken', () async { testConfig = PostHogConfig(' \n test_project_token\t '); await posthogFlutterIO.setup(testConfig); final call = log.firstWhere((c) => c.method == 'setup'); final args = Map.from(call.arguments as Map); expect(args['projectToken'], equals('test_project_token')); - expect(args['apiKey'], equals('test_project_token')); + expect(args.containsKey('apiKey'), isFalse); }); test( diff --git a/posthog_flutter/test/posthog_flutter_platform_interface_fake.dart b/posthog_flutter/test/posthog_flutter_platform_interface_fake.dart index 8b0bb563..2fad6e75 100644 --- a/posthog_flutter/test/posthog_flutter_platform_interface_fake.dart +++ b/posthog_flutter/test/posthog_flutter_platform_interface_fake.dart @@ -95,7 +95,6 @@ class PosthogFlutterPlatformFake extends PosthogFlutterPlatformInterface { // Feature flag test data final Map featureFlagValues = {}; - final Map featureFlagPayloads = {}; // Call tracking for getFeatureFlagResult final List> getFeatureFlagResultCalls = []; @@ -255,11 +254,6 @@ class PosthogFlutterPlatformFake extends PosthogFlutterPlatformInterface { return featureFlagValues[key]; } - @override - Future getFeatureFlagPayload({required String key}) async { - return featureFlagPayloads[key]; - } - PostHogFeatureFlagResult? featureFlagResult; @override diff --git a/posthog_flutter/test/posthog_test.dart b/posthog_flutter/test/posthog_test.dart index f526f3bd..7c249234 100644 --- a/posthog_flutter/test/posthog_test.dart +++ b/posthog_flutter/test/posthog_test.dart @@ -176,10 +176,8 @@ void main() { config.host = ' \nhttps://eu.i.posthog.com/\t '; expect(config.projectToken, equals('test_project_token')); - expect(config.apiKey, equals('test_project_token')); expect(config.host, equals('https://eu.i.posthog.com/')); expect(config.toMap()['projectToken'], equals('test_project_token')); - expect(config.toMap()['apiKey'], equals('test_project_token')); expect(config.toMap()['host'], equals('https://eu.i.posthog.com/')); }); diff --git a/posthog_flutter/test/snapshots/setup_request.json b/posthog_flutter/test/snapshots/setup_request.json index 58543998..367138b4 100644 --- a/posthog_flutter/test/snapshots/setup_request.json +++ b/posthog_flutter/test/snapshots/setup_request.json @@ -3,7 +3,6 @@ "method": "setup", "arguments": { "projectToken": "snapshot_project_token", - "apiKey": "snapshot_project_token", "host": "https://eu.i.posthog.com", "flushAt": 12, "maxQueueSize": 800, From a708159d56c5c2571d85d74792d9749863ee4064 Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Mon, 5 Oct 2026 16:01:33 -0400 Subject: [PATCH 2/7] chore(android): declare minSdkVersion 23 to match posthog-android posthog-android has required minSdk 23 since 3.39.0, and the plugin's dependency range [3.71.0, 4.0.0) only resolves to versions that need it. Apps below 23 already fail the manifest merge, so this only corrects the declared value. Co-Authored-By: Claude Opus 5.5 (1M context) --- .changeset/v6-posthog-ios-4.md | 1 + api/posthog_flutter.api.json | 2 +- posthog_flutter/android/build.gradle | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.changeset/v6-posthog-ios-4.md b/.changeset/v6-posthog-ios-4.md index a6c1f81b..fb6a772c 100644 --- a/.changeset/v6-posthog-ios-4.md +++ b/.changeset/v6-posthog-ios-4.md @@ -7,3 +7,4 @@ - **Breaking:** remove `Posthog().getFeatureFlagPayload()` — use `getFeatureFlagResult(key, sendEvent: false)` and read `payload` - **Breaking:** remove the `PostHogSessionReplayConfig.debouncerDelay` setter — use `PostHogSessionReplayConfig.throttleDelay` - **Breaking:** remove `PostHogDataMode.cellular` — use `PostHogDataMode.any`, which it always behaved like +- Declare Android `minSdkVersion` 23 to match `posthog-android`, which has required it since 3.39.0. Apps on minSdk 21 or 22 already could not build with this plugin, so nothing changes for them diff --git a/api/posthog_flutter.api.json b/api/posthog_flutter.api.json index b07cfe8f..aa0a9fde 100644 --- a/api/posthog_flutter.api.json +++ b/api/posthog_flutter.api.json @@ -13,7 +13,7 @@ "packageApi": { "androidPlatformConstraints": { "compileSdkVersion": null, - "minSdkVersion": 21, + "minSdkVersion": 23, "targetSdkVersion": null }, "executableDeclarations": [ diff --git a/posthog_flutter/android/build.gradle b/posthog_flutter/android/build.gradle index ba6dcb54..2ae6e792 100644 --- a/posthog_flutter/android/build.gradle +++ b/posthog_flutter/android/build.gradle @@ -58,7 +58,7 @@ android { } defaultConfig { - minSdkVersion 21 + minSdkVersion 23 } dependencies { From 9279d41a22e86e3d011759cbf3c841e95d028fc7 Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Mon, 5 Oct 2026 16:38:10 -0400 Subject: [PATCH 3/7] chore!: require macOS 11 posthog-ios 4.0 raises its macOS minimum to 11 (PostHog/posthog-ios#906). Also drops the macOS 11 / iOS 14 availability check that is now always true. Co-Authored-By: Claude Opus 5.5 (1M context) --- .changeset/v6-posthog-ios-4.md | 2 +- example/macos/Podfile | 2 +- example/macos/Runner.xcodeproj/project.pbxproj | 6 +++--- posthog_flutter/darwin/posthog_flutter.podspec | 3 +-- posthog_flutter/darwin/posthog_flutter/Package.swift | 2 +- .../Sources/posthog_flutter/PosthogFlutterPlugin.swift | 4 +--- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.changeset/v6-posthog-ios-4.md b/.changeset/v6-posthog-ios-4.md index fb6a772c..4d71fd3d 100644 --- a/.changeset/v6-posthog-ios-4.md +++ b/.changeset/v6-posthog-ios-4.md @@ -2,7 +2,7 @@ "posthog_flutter": major --- -- **Breaking:** bump minimum iOS deployment target from 13.0 to 15.0 and require Xcode 26, adopting `posthog-ios` 4.x +- **Breaking:** bump minimum iOS deployment target from 13.0 to 15.0 and macOS from 10.15 to 11.0, and require Xcode 26, adopting `posthog-ios` 4.x - **Breaking:** remove `PostHogConfig.apiKey` and the `com.posthog.posthog.API_KEY` manifest/Info.plist key — use `projectToken` and `com.posthog.posthog.PROJECT_TOKEN` - **Breaking:** remove `Posthog().getFeatureFlagPayload()` — use `getFeatureFlagResult(key, sendEvent: false)` and read `payload` - **Breaking:** remove the `PostHogSessionReplayConfig.debouncerDelay` setter — use `PostHogSessionReplayConfig.throttleDelay` diff --git a/example/macos/Podfile b/example/macos/Podfile index b52666a1..dbccf89c 100644 --- a/example/macos/Podfile +++ b/example/macos/Podfile @@ -1,4 +1,4 @@ -platform :osx, '10.15' +platform :osx, '11.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index f6c36aa8..c0dda7a1 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -549,7 +549,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -628,7 +628,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -675,7 +675,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; + MACOSX_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/posthog_flutter/darwin/posthog_flutter.podspec b/posthog_flutter/darwin/posthog_flutter.podspec index a22019d8..d50d58d6 100644 --- a/posthog_flutter/darwin/posthog_flutter.podspec +++ b/posthog_flutter/darwin/posthog_flutter.podspec @@ -24,8 +24,7 @@ Postog flutter plugin s.dependency 'PostHog', '>= 4.0.0', '< 5.0.0' s.ios.deployment_target = '15.0' - # PH iOS SDK 3.0.0 requires >= 10.15 - s.osx.deployment_target = '10.15' + s.osx.deployment_target = '11.0' # Flutter.framework does not contain a i386 slice. s.ios.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/posthog_flutter/darwin/posthog_flutter/Package.swift b/posthog_flutter/darwin/posthog_flutter/Package.swift index 4d02be7c..5d2d9474 100644 --- a/posthog_flutter/darwin/posthog_flutter/Package.swift +++ b/posthog_flutter/darwin/posthog_flutter/Package.swift @@ -7,7 +7,7 @@ let package = Package( name: "posthog_flutter", platforms: [ .iOS("15.0"), - .macOS("10.15"), + .macOS("11.0"), ], products: [ .library(name: "posthog-flutter", targets: ["posthog_flutter"]), diff --git a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift index d6b7a77a..a69380be 100644 --- a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift +++ b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift @@ -104,9 +104,7 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin { /// a later `FlutterEngine` registers — that setup() has already run, so use the plist key there. private static func prewarmPushNotificationOpenCapture() { guard plistCapturePushNotificationOpened else { return } - if #available(iOS 14.0, macOS 11.0, *) { - PostHogSDK.prewarmPushNotificationOpenCapture() - } + PostHogSDK.prewarmPushNotificationOpenCapture() } private static var plistCapturePushNotificationOpened: Bool { From 90664efc63c0da2c540cf8f07b8cee69d0b22d1d Mon Sep 17 00:00:00 2001 From: Anna Garcia <11654201+turnipdabeets@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:35:01 -0400 Subject: [PATCH 4/7] chore!: remove enable/disable and sendFeatureFlagEvents (#638) Removes the names deprecated in 5.x in favor of optIn/optOut and sendFeatureFlagEvent. Co-authored-by: Claude Opus 5.5 (1M context) --- .changeset/v6-remove-5x-deprecations.md | 6 ++++ api/posthog_flutter.api.json | 35 --------------------- posthog_flutter/lib/src/posthog.dart | 12 ------- posthog_flutter/lib/src/posthog_config.dart | 11 ------- posthog_flutter/test/posthog_test.dart | 10 ------ 5 files changed, 6 insertions(+), 68 deletions(-) create mode 100644 .changeset/v6-remove-5x-deprecations.md diff --git a/.changeset/v6-remove-5x-deprecations.md b/.changeset/v6-remove-5x-deprecations.md new file mode 100644 index 00000000..7cde3baa --- /dev/null +++ b/.changeset/v6-remove-5x-deprecations.md @@ -0,0 +1,6 @@ +--- +"posthog_flutter": major +--- + +- **Breaking:** remove `Posthog().enable()` and `Posthog().disable()` — use `optIn()` and `optOut()` +- **Breaking:** remove `PostHogConfig.sendFeatureFlagEvents` — use `sendFeatureFlagEvent` diff --git a/api/posthog_flutter.api.json b/api/posthog_flutter.api.json index aa0a9fde..459d349e 100644 --- a/api/posthog_flutter.api.json +++ b/api/posthog_flutter.api.json @@ -2195,17 +2195,6 @@ "relativePath": "lib/src/posthog_config.dart", "typeName": "bool" }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isReadable": true, - "isStatic": false, - "isWriteable": true, - "name": "sendFeatureFlagEvents", - "relativePath": "lib/src/posthog_config.dart", - "typeName": "bool" - }, { "entryPoints": [], "isDeprecated": false, @@ -4286,30 +4275,6 @@ "type": "method", "typeParameterNames": [] }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isStatic": false, - "name": "disable", - "parameters": [], - "relativePath": "lib/src/posthog.dart", - "returnTypeName": "Future", - "type": "method", - "typeParameterNames": [] - }, - { - "entryPoints": [], - "isDeprecated": true, - "isExperimental": false, - "isStatic": false, - "name": "enable", - "parameters": [], - "relativePath": "lib/src/posthog.dart", - "returnTypeName": "Future", - "type": "method", - "typeParameterNames": [] - }, { "entryPoints": [], "isDeprecated": false, diff --git a/posthog_flutter/lib/src/posthog.dart b/posthog_flutter/lib/src/posthog.dart index e444c4bc..847cbcec 100644 --- a/posthog_flutter/lib/src/posthog.dart +++ b/posthog_flutter/lib/src/posthog.dart @@ -398,18 +398,6 @@ class Posthog { return _posthog.enable(); } - /// Opts the current user out of data collection. - @Deprecated( - 'Use optOut() instead. This will be removed in the next major version.', - ) - Future disable() => optOut(); - - /// Opts the current user back in to data collection. - @Deprecated( - 'Use optIn() instead. This will be removed in the next major version.', - ) - Future enable() => optIn(); - /// Returns whether the current user has opted out of data collection. Future isOptOut() => _posthog.isOptOut(); diff --git a/posthog_flutter/lib/src/posthog_config.dart b/posthog_flutter/lib/src/posthog_config.dart index 5bd9230b..78b2c2c8 100644 --- a/posthog_flutter/lib/src/posthog_config.dart +++ b/posthog_flutter/lib/src/posthog_config.dart @@ -124,17 +124,6 @@ class PostHogConfig { /// Defaults to `true`. var sendFeatureFlagEvent = true; - /// Deprecated alias for [sendFeatureFlagEvent]. - @Deprecated( - 'Use sendFeatureFlagEvent instead. This will be removed in the next major version.', - ) - bool get sendFeatureFlagEvents => sendFeatureFlagEvent; - - @Deprecated( - 'Use sendFeatureFlagEvent instead. This will be removed in the next major version.', - ) - set sendFeatureFlagEvents(bool value) => sendFeatureFlagEvent = value; - /// Whether feature flags are loaded when the SDK starts. /// /// Defaults to `true`, which means every SDK start issues a `/flags` request. diff --git a/posthog_flutter/test/posthog_test.dart b/posthog_flutter/test/posthog_test.dart index 7c249234..fcec7dcf 100644 --- a/posthog_flutter/test/posthog_test.dart +++ b/posthog_flutter/test/posthog_test.dart @@ -161,16 +161,6 @@ void main() { }); group('PostHogConfig', () { - test('sendFeatureFlagEvents forwards to sendFeatureFlagEvent', () { - final config = PostHogConfig('test_project_token'); - - // ignore: deprecated_member_use_from_same_package - config.sendFeatureFlagEvents = false; - - expect(config.sendFeatureFlagEvent, isFalse); - expect(config.toMap()['sendFeatureFlagEvents'], isFalse); - }); - test('trims whitespace-sensitive config values in config and toMap', () { final config = PostHogConfig(' \n test_project_token\t '); config.host = ' \nhttps://eu.i.posthog.com/\t '; From f5765e05c5bbeddd117a66477fa262f948af93b6 Mon Sep 17 00:00:00 2001 From: Anna Garcia <11654201+turnipdabeets@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:35:31 -0400 Subject: [PATCH 5/7] chore: adapt to posthog-ios 4.0 reloadFeatureFlags callback (#643) posthog-ios 4.0 passes a PostHogFeatureFlagsLoaded to the reloadFeatureFlags(_:) callback (PostHog/posthog-ios#913). Co-authored-by: Claude Opus 5.5 (1M context) --- .../Sources/posthog_flutter/PosthogFlutterPlugin.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift index a69380be..a99dd547 100644 --- a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift +++ b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift @@ -1540,7 +1540,7 @@ extension PosthogFlutterPlugin { private func reloadFeatureFlags(_ result: @escaping FlutterResult) { // Resolve the Dart Future only once flags have actually finished loading. // The native callback fires on a background thread, so hop to main for Flutter. - PostHogSDK.shared.reloadFeatureFlags { + PostHogSDK.shared.reloadFeatureFlags { _ in DispatchQueue.main.async { result(nil) } From cbfa0450619c5daa50f6f63c59ee69b80286df65 Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Tue, 6 Oct 2026 21:43:37 -0400 Subject: [PATCH 6/7] chore!: note posthog-ios 4.0 feature flag payload decoding changes Co-Authored-By: Claude Opus 5.5 (1M context) --- .changeset/v6-ios-payload-decoding.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/v6-ios-payload-decoding.md diff --git a/.changeset/v6-ios-payload-decoding.md b/.changeset/v6-ios-payload-decoding.md new file mode 100644 index 00000000..c154c01f --- /dev/null +++ b/.changeset/v6-ios-payload-decoding.md @@ -0,0 +1,6 @@ +--- +"posthog_flutter": major +--- + +- **Breaking:** return `null` instead of the raw string for a malformed, empty, or whitespace-only feature flag payload on iOS and macOS +- **Breaking:** keep bootstrapped string payloads such as `"123"` or `"true"` as strings on iOS and macOS instead of decoding them to numbers or booleans, matching Android From 7d9998de58bef3ef53656a25a55523bc720fd74a Mon Sep 17 00:00:00 2001 From: Anna Garcia Date: Tue, 6 Oct 2026 21:44:18 -0400 Subject: [PATCH 7/7] chore: name the affected APIs in the payload changeset Co-Authored-By: Claude Opus 5.5 (1M context) --- .changeset/v6-ios-payload-decoding.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/v6-ios-payload-decoding.md b/.changeset/v6-ios-payload-decoding.md index c154c01f..443e9d1d 100644 --- a/.changeset/v6-ios-payload-decoding.md +++ b/.changeset/v6-ios-payload-decoding.md @@ -2,5 +2,5 @@ "posthog_flutter": major --- -- **Breaking:** return `null` instead of the raw string for a malformed, empty, or whitespace-only feature flag payload on iOS and macOS -- **Breaking:** keep bootstrapped string payloads such as `"123"` or `"true"` as strings on iOS and macOS instead of decoding them to numbers or booleans, matching Android +- **Breaking:** return `null` instead of the raw string for a malformed, empty, or whitespace-only `getFeatureFlagResult()` payload on iOS and macOS +- **Breaking:** keep string payloads passed to `PostHogBootstrapConfig.featureFlagPayloads`, such as `"123"`, as strings on iOS and macOS instead of decoding them to numbers or booleans