diff --git a/.changeset/deprecate-cellular-data-mode.md b/.changeset/deprecate-cellular-data-mode.md new file mode 100644 index 00000000..622dfb59 --- /dev/null +++ b/.changeset/deprecate-cellular-data-mode.md @@ -0,0 +1,4 @@ +--- +'posthog_flutter': patch +--- +Deprecate `PostHogDataMode.cellular`, which always behaved like `PostHogDataMode.any`; use `any` instead. diff --git a/api/posthog_flutter.api.json b/api/posthog_flutter.api.json index 44a08b7a..901c65ff 100644 --- a/api/posthog_flutter.api.json +++ b/api/posthog_flutter.api.json @@ -2941,7 +2941,7 @@ }, { "entryPoints": [], - "isDeprecated": false, + "isDeprecated": true, "isExperimental": false, "isReadable": true, "isStatic": true, 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 cbf3b366..f00c34e9 100644 --- a/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift +++ b/posthog_flutter/darwin/posthog_flutter/Sources/posthog_flutter/PosthogFlutterPlugin.swift @@ -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 default: break diff --git a/posthog_flutter/lib/src/posthog_config.dart b/posthog_flutter/lib/src/posthog_config.dart index f8f7691a..2d3fbfb5 100644 --- a/posthog_flutter/lib/src/posthog_config.dart +++ b/posthog_flutter/lib/src/posthog_config.dart @@ -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.