Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/deprecate-cellular-data-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
'posthog_flutter': patch
---
Deprecate `PostHogDataMode.cellular`, which always behaved like `PostHogDataMode.any`; use `any` instead.
2 changes: 1 addition & 1 deletion api/posthog_flutter.api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2941,7 +2941,7 @@
},
{
"entryPoints": [],
"isDeprecated": false,
"isDeprecated": true,
"isExperimental": false,
"isReadable": true,
"isStatic": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin {
switch dataMode {
case "wifi":
config.dataMode = .wifi
case "cellular":
config.dataMode = .cellular
case "any":
case "any", "cellular":
config.dataMode = .any
Comment on lines +238 to 239

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Version 4 remains excluded The new mapping removes the .cellular reference, but the CocoaPods and Swift Package Manager dependencies both require posthog-ios versions below 4.0.0. Neither can select 4.0, so this change does not yet unblock it. Widen both dependency ranges and build against 4.0 to verify compatibility.

Knowledge Base Used: SDK configuration and platform integrations

Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift
Line: 238-239

Comment:
**Version 4 remains excluded** The new mapping removes the `.cellular` reference, but the CocoaPods and Swift Package Manager dependencies both require posthog-ios versions below 4.0.0. Neither can select 4.0, so this change does not yet unblock it. Widen both dependency ranges and build against 4.0 to verify compatibility.

**Knowledge Base Used:** [SDK configuration and platform integrations](https://app.greptile.com/posthog-org-19734/-/custom-context/knowledge-base/posthog/posthog-flutter/-/docs/sdk-configuration-and-platforms.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

default:
break
Expand Down
10 changes: 9 additions & 1 deletion posthog_flutter/lib/src/posthog_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ enum PostHogDataMode {
/// Send data only on Wi-Fi connections.
wifi,

/// Send data only on cellular connections.
/// 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.
Expand Down
Loading