diff --git a/contents/docs/feature-flags/cutting-costs.mdx b/contents/docs/feature-flags/cutting-costs.mdx index f26c69b79c48..0a03fb25d6c4 100644 --- a/contents/docs/feature-flags/cutting-costs.mdx +++ b/contents/docs/feature-flags/cutting-costs.mdx @@ -211,7 +211,7 @@ final config = PostHogConfig(''); if (isTestEnv) { config.preloadFeatureFlags = false; - config.sendFeatureFlagEvents = false; + config.sendFeatureFlagEvent = false; config.flushAt = 100; config.flushInterval = const Duration(seconds: 120); } diff --git a/contents/docs/integrate/_snippets/install-flutter-manual.mdx b/contents/docs/integrate/_snippets/install-flutter-manual.mdx index 8e5863b33bf4..4cd09b2f804c 100644 --- a/contents/docs/integrate/_snippets/install-flutter-manual.mdx +++ b/contents/docs/integrate/_snippets/install-flutter-manual.mdx @@ -59,17 +59,17 @@ Add your PostHog configuration to the `Info.plist` file located in the `ios/Runn ``` -You'll need to set the minimum platform version to iOS 13.0. +You'll need to set the minimum platform version to iOS 15.0. Building for iOS requires Xcode 26 or later. For CocoaPods projects, set it in your `Podfile`: ```yaml file=ios/Podfile -platform :ios, '13.0' +platform :ios, '15.0' # rest of your config ``` -For Swift Package Manager projects without a `Podfile`, set the **Minimum Deployments** version to iOS 13.0 for the `Runner` target in Xcode (**Runner > General > Minimum Deployments**). +For Swift Package Manager projects without a `Podfile`, set the **Minimum Deployments** version to iOS 15.0 for the `Runner` target in Xcode (**Runner > General > Minimum Deployments**). #### Dart setup diff --git a/contents/docs/integrate/_snippets/install-flutter.mdx b/contents/docs/integrate/_snippets/install-flutter.mdx index 85c0ac6e1982..8d7f3c2f83c6 100644 --- a/contents/docs/integrate/_snippets/install-flutter.mdx +++ b/contents/docs/integrate/_snippets/install-flutter.mdx @@ -112,16 +112,16 @@ Add your PostHog configuration to the `Info.plist` file located in the `ios/Runn ``` -In both cases, you'll need to set the minimum platform version to iOS 13.0. +In both cases, you'll need to set the minimum platform version to iOS 15.0. Building for iOS requires Xcode 26 or later. For CocoaPods projects, set it in your `Podfile`: ```yaml file=ios/Podfile -platform :ios, '13.0' +platform :ios, '15.0' # rest of your config ``` -For Swift Package Manager projects without a `Podfile`, set the **Minimum Deployments** version to iOS 13.0 for the `Runner` target in Xcode (**Runner > General > Minimum Deployments**). After you change **Minimum Deployments**, regenerate the iOS project's configuration files: +For Swift Package Manager projects without a `Podfile`, set the **Minimum Deployments** version to iOS 15.0 for the `Runner` target in Xcode (**Runner > General > Minimum Deployments**). After you change **Minimum Deployments**, regenerate the iOS project's configuration files: ```bash flutter build ios --config-only diff --git a/contents/docs/libraries/flutter/index.mdx b/contents/docs/libraries/flutter/index.mdx index 85e85a0a723a..af217e013d58 100644 --- a/contents/docs/libraries/flutter/index.mdx +++ b/contents/docs/libraries/flutter/index.mdx @@ -13,7 +13,7 @@ features: featureFlags: true groupAnalytics: true surveys: true - aiObservability: false + aiObservability: true errorTracking: true logs: true --- @@ -22,7 +22,7 @@ import FlutterIdentify from './_snippets/identify.mdx' This is an optional library you can install if you're working with Flutter. It uses an internal queue to make calls fast and non-blocking. It also batches requests and flushes asynchronously, making it perfect to use in any part of your mobile app. -PostHog supports the iOS, macOS, Android, and Web platforms. +PostHog supports the iOS, macOS, Android, Web, Windows, and Linux platforms. ## Installation @@ -73,6 +73,70 @@ import FlutterSendEvents from '../../integrate/send-events/_snippets/send-events +## Event options + +`capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group`, `captureException` and `captureAi` take an optional `options` map. Options tell PostHog how to process the event and are sent apart from its properties. + +```dart +await Posthog().capture( + eventName: 'signed_up', + options: {'process_person_profile': false}, +); +``` + +| Option | Type | What it does | Legacy property | +| --- | --- | --- | --- | +| `process_person_profile` | `bool` | Whether PostHog creates or updates a person profile for this event | `$process_person_profile` | +| `cookieless_mode` | `bool` | Whether PostHog processes this event in cookieless mode | `$cookieless_mode` | +| `disable_skew_correction` | `bool` | Whether PostHog keeps the event timestamp as sent instead of correcting it for device clock skew | `$ignore_sent_at` | +| `product_tour_id` | `String` | The product tour the event belongs to | `$product_tour_id` | + +- An option wins over its legacy property. A `null` option counts as unset. +- `beforeSend` can read and change the options of the events it receives through `PostHogEvent.options`: + + ```dart + final config = PostHogConfig(''); + config.beforeSend = [ + (event) { + event.options = {...?event.options, 'cookieless_mode': true}; + return event; + }, + ]; + ``` + +- On iOS, macOS, Android, Windows and Linux, other option keys are sent unchanged. +- On web, the known options are sent as their legacy properties and other keys are dropped. `posthog-js` sets `$process_person_profile` itself, so `process_person_profile` has no effect on web, and the options of `identify`, `setPersonProperties`, `alias` and `group` are dropped. + +## Capturing AI events + +`captureAi` sends AI events such as `$ai_generation`, `$ai_span`, `$ai_trace` and `$ai_embedding` to PostHog's AI endpoint, which accepts much larger events than `capture`. It takes the same arguments as `capture` and goes through the same `beforeSend` callbacks. + +```dart +final uuid = await Posthog().captureAi( + eventName: r'$ai_generation', + properties: { + r'$ai_trace_id': traceId, + r'$ai_model': 'gpt-4o', + r'$ai_provider': 'openai', + }, +); +``` + +- `captureAi` returns the event's UUID, or `null` when the event isn't queued and won't be sent: `beforeSend` dropped it, it's over `captureAiMaxEventBytes`, the SDK is disabled, not set up or opted out, or the app is running on web. +- On web, `captureAi` is a no-op: it sends nothing and returns `null`. +- PostHog drops an event sent with `captureAi` whose name doesn't start with `$ai_`. `capture` never sends events to the AI endpoint, even ones named `$ai_*`. +- The SDK sends AI events unchanged. It doesn't redact or truncate prompts, outputs or media, so use `beforeSend` to remove anything you don't want to send. +- AI events are queued separately from other events. `flush()` and `close()` send both queues. + +These `PostHogConfig` settings control the AI queue and its requests. They have no effect on web. + +| Setting | Default | Description | +| --- | --- | --- | +| `captureAiCompression` | `PostHogCompression.gzip` | How AI request bodies are compressed, separately from `compression` | +| `captureAiMaxQueueSize` | 100 | Maximum number of AI events kept in the queue before the oldest are dropped. The queue also keeps at most 50 MiB of AI events, whatever this is set to. A value of `0` or less uses the default | +| `captureAiTimeout` | 60 seconds | How long an AI request can go without network activity before it fails. `Duration.zero` or less uses the default. iOS, macOS and Android use whole seconds | +| `captureAiMaxEventBytes` | 8 MiB + 64 KiB | Maximum size of an AI event, measured before compression. Use it to lower the limit: a larger value, or a value of `0` or less, uses the default | + ## Identifying users > We highly recommend reading our section on [Identifying users](/docs/integrate/identifying-users) to better understand how to correctly use this method. @@ -282,19 +346,21 @@ The PostHog Flutter SDK will continue to capture events when the device is offli ## Opt out of data capture -You can disable data collection for a user at any time using the `disable()` method: +You can disable data collection for a user at any time using the `optOut()` method: ```dart -await Posthog().disable(); +await Posthog().optOut(); ``` This prevents any future events from being sent. It doesn't remove events already captured for the user. To opt the user back in: ```dart -await Posthog().enable(); +await Posthog().optIn(); ``` +`optOut()` and `optIn()` require version 5.51.0 or later. Earlier versions use `disable()` and `enable()`, which version 6 removes. + To check if a user is opted out: ```dart @@ -367,15 +433,36 @@ config.beforeSend = [ The `beforeSend` callbacks only apply to events captured via Dart APIs: - `Posthog().capture()` - custom events +- `Posthog().captureAi()` - AI events - `Posthog().screen()` - screen events (event name is `$screen`) - `Posthog().captureException()` - exception events (event name is `$exception`) -They do **not** intercept native-initiated events such as: +`identify`, `alias`, `group` and `setPersonProperties` don't go through them, and neither do events the native SDK captures itself, such as: - Session replay events (`$snapshot`) - Application lifecycle events (`Application Opened`, etc.) +- Crash events +- `$feature_flag_called` events + +Since version 6, the callbacks get the final event on every platform, with the system properties (like `$device_type` and `$session_id`) and registered super properties the SDK adds, and their changes are final. On iOS, macOS and Android, `PostHogEvent` also has the event's `uuid`, `distinctId` and `timestamp`. -Additionally, only user-provided properties are available in the callback. System properties (like `$device_type`, `$session_id`) are added by the native SDK at a later stage. +### Filtering native events + +On iOS, macOS and Android, use `PosthogFlutterPlugin.addBeforeSend` to change or drop the events the native SDK captures itself. Native hooks run on every event, in the order you add them, after the Dart callbacks. Return the event to send it, or `nil`/`null` to drop it. Add them before the SDK is set up. + +```swift +// AppDelegate.swift, before GeneratedPluginRegistrant.register(with: self) +PosthogFlutterPlugin.addBeforeSend { event in + event.event == "Application Backgrounded" ? nil : event +} +``` + +```kotlin +// MainApplication.onCreate +PosthogFlutterPlugin.addBeforeSend { event -> + if (event.event == "Application Backgrounded") null else event +} +``` ## Debug mode @@ -398,3 +485,200 @@ You can also enable debug by calling the `Posthog().debug()` method in your code await Posthog().debug(true); await Posthog().debug(false); ``` + +## Upgrading from version 5 to version 6 + +Version 6 moves iOS and macOS to `posthog-ios` 4.0 and Android to `posthog-android` 4.0, sends events to PostHog's capture v1 API on every platform except web, raises the minimum iOS and macOS versions, and removes the APIs that version 5 deprecated. + +If you send events through a reverse proxy or to a self-hosted PostHog instance, read [Events go to capture v1](#events-go-to-capture-v1) before you upgrade. + +Before you upgrade, update to the latest version 5 release and fix its deprecation warnings. The replacements below work in both versions, with one exception: the parameter of `getFeatureFlagResult()` that controls the `$feature_flag_called` event is named `sendEvent` in version 5 and `sendFeatureFlagEvent` in version 6. Version 6 also removes a few members that version 5 never marked as deprecated: the `sendEvent` parameter itself, the `toMap()` and `fromMap()` helpers, and some members of the platform interface classes. + +### Platform requirements + +| Platform | Version 5 | Version 6 | +| --- | --- | --- | +| iOS | 13.0 | 15.0 | +| macOS | 10.15 | 11.0 | +| Xcode | – | 26 or later | +| Android | API 23 | API 23 (unchanged) | + +For CocoaPods projects, raise the platform version in your `Podfile`: + +```ruby file=ios/Podfile +platform :ios, '15.0' +``` + +If your app also targets macOS, do the same in `macos/Podfile`: + +```ruby file=macos/Podfile +platform :osx, '11.0' +``` + +For Swift Package Manager projects without a `Podfile`, set **Minimum Deployments** for the `Runner` target in Xcode (**Runner > General > Minimum Deployments**), then regenerate the project's configuration files: + +```bash +flutter build ios --config-only +# If your app also targets macOS +flutter build macos --config-only +``` + +### Removed APIs + +| Removed in version 6 | Use instead | +| --- | --- | +| `PostHogConfig.apiKey` | `PostHogConfig.projectToken` | +| `com.posthog.posthog.API_KEY` in `AndroidManifest.xml` or `Info.plist` | `com.posthog.posthog.PROJECT_TOKEN` | +| `Posthog().disable()` and `Posthog().enable()` | `Posthog().optOut()` and `Posthog().optIn()` | +| `Posthog().getFeatureFlagPayload(key)` | `Posthog().getFeatureFlagResult(key, sendFeatureFlagEvent: false)`, then read `payload` (`sendEvent: false` in version 5) | +| The `sendEvent` parameter of `getFeatureFlagResult()` | `sendFeatureFlagEvent` | +| `PostHogConfig.sendFeatureFlagEvents` | `PostHogConfig.sendFeatureFlagEvent` | +| `PostHogSessionReplayConfig.debouncerDelay` | `PostHogSessionReplayConfig.throttleDelay` | +| `PostHogDataMode.cellular` | `PostHogDataMode.any`, which `cellular` always behaved like | +| `toMap()` on the config classes, and `PostHogFeatureFlagResult.fromMap()` | None. They serialize the SDK's internal format and aren't meant for app code | + +For example, to read a flag payload. Pass `false` to keep the old behavior: `getFeatureFlagResult()` captures a `$feature_flag_called` event by default, and `getFeatureFlagPayload()` didn't. + +```dart +// Version 5 +final payload = await Posthog().getFeatureFlagPayload('my-flag'); + +// Version 6 +final result = await Posthog().getFeatureFlagResult( + 'my-flag', + sendFeatureFlagEvent: false, +); +final payload = result?.payload; +``` + +If you implement or mock `PosthogFlutterPlatformInterface`, `PosthogFlutterIO` or `PosthogFlutterWeb` directly, for example in tests: + +- Rename `enable()` and `disable()` to `optIn()` and `optOut()`. +- Remove `getFeatureFlagPayload()`. +- Rename the `sendEvent` parameter of `getFeatureFlagResult()` to `sendFeatureFlagEvent`. + +Calls to `Posthog()` aren't affected by these. + +### Feature flag callbacks + +`PostHogConfig.onFeatureFlags` now receives a `PostHogFeatureFlagsLoaded` with the enabled flags, their values and whether loading failed, and `reloadFeatureFlags()` returns a `Future`. Callbacks written as `() { ... }` no longer compile: + +```dart +// Version 5 +config.onFeatureFlags = () { + // ... +}; + +// Version 6 +config.onFeatureFlags = (loaded) { + // ... +}; +``` + +### Synchronous `beforeSend` + +`beforeSend` callbacks, including `logsConfig.beforeSend`, are now synchronous. An `async` callback is a compile error, so load anything it needs ahead of time and read it synchronously. + +A `reset()`, `identify()` or `optOut()` made straight after an un-awaited `capture()`, `screen()` or `captureException()` no longer applies to that event first. + +### Events go to capture v1 + +On iOS, macOS, Android, Windows and Linux, version 6 sends events to capture v1 instead of `/batch/`. iOS and macOS do this through `posthog-ios` 4.0, Android through `posthog-android` 4.0, and Windows and Linux in the SDK's Dart client. + +Web is unchanged. Flutter web runs `posthog-js`, which keeps sending events to the endpoints it uses today. + +| Data | Version 5 | Version 6 on iOS, macOS, Android, Windows and Linux | +| --- | --- | --- | +| Events | `/batch/` | `/i/v1/analytics/events` | +| AI events (`captureAi`) | – | `/i/v1/ai/events` | + +Session replay, logs and feature flags keep their endpoints. + +PostHog Cloud serves both capture v1 endpoints. If you self-host PostHog, check that your instance serves `/i/v1/analytics/events` and `/i/v1/ai/events` before you upgrade. + +If you send events through your own reverse proxy, update it before you upgrade: + +- Forward `/i/v1/analytics/events` and `/i/v1/ai/events` to PostHog. +- Pass `Authorization` (the project token, sent as `Bearer `), every `PostHog-*` header, `Content-Type`, `Content-Encoding` and `User-Agent` through unchanged. +- If your proxy strips other credentials, keep `Authorization` values that start with `Bearer phc_`. If your project token doesn't start with `phc_`, keep the exact value `Bearer `. +- Accept request bodies up to 20 MB. AI requests are often larger than 1 MB, the default limit in NGINX. +- If your app also runs on web, keep the routes the proxy already forwards for `posthog-js`. One proxy that serves every platform needs both sets of routes. + +PostHog's [managed reverse proxy](/docs/advanced/proxy/managed-reverse-proxy) already does this. + +The SDK doesn't fall back to `/batch/`. A 404 is retried, so events stay queued until the path is served. + +Other changes that come with capture v1, on every platform except web: + +- **Redirects:** the SDK only follows a 307 or 308 redirect to the same origin as `host`. Any other redirect drops the batch. If your proxy redirects capture requests to another host, point `host` at the final host. +- **Event validation:** PostHog checks each event on its own and drops only the invalid ones, so the rest of the batch is delivered. It drops an event with an empty name, an empty distinct ID, or a name or distinct ID over 200 UTF-8 bytes. Version 5 shortened a long distinct ID and kept the event. If you identify users with a long ID, such as a JWT, shorten or hash it before you upgrade. +- **`$lib` and `$lib_version`:** PostHog sets them from the SDK's `PostHog-Sdk-Info` request header. A value you set in properties or in `beforeSend` doesn't reach PostHog. +- **Personal API keys:** a personal API key (`phx_...`) in `projectToken` disables the SDK at setup. Use your project token (`phc_...`). + +### Property precedence + +On iOS, macOS, Android, Windows and Linux, an event's properties are merged in this order, and later values win: + +1. properties the SDK sets itself, such as device and app context, `$is_identified` and `$session_id` +2. registered super properties (`register`) +3. the properties you pass to `capture` or another event-sending method + +In version 5, the SDK's own values won over the properties you registered or passed. In version 6, your value wins for that event. A registered `$session_id` now overrides the SDK's session ID, which can detach events from their session replay. + +`beforeSend` runs after the merge, so it sees and can change every property and option the SDK adds. In version 5, on iOS, macOS and Android, it ran before the native SDK added its properties and saw only the properties you passed. + +### Per-event options + +Capture v1 reads processing settings from an `options` map sent next to the event's properties. `capture`, `screen`, `identify`, `setPersonProperties`, `alias`, `group` and `captureException` take a new `options` argument, and `beforeSend` can read and change `PostHogEvent.options`. + +```dart +// Version 5 +await Posthog().capture( + eventName: 'signed_up', + properties: {r'$cookieless_mode': true}, +); + +// Version 6 +await Posthog().capture( + eventName: 'signed_up', + options: {'cookieless_mode': true}, +); +``` + +The legacy properties still work, but an option wins over its legacy property. See [Event options](#event-options) for the known options, their legacy properties and the limits on web. + +### AI events + +Version 6 adds `captureAi`, which sends AI events to `/i/v1/ai/events`, and the `captureAiCompression`, `captureAiMaxQueueSize`, `captureAiTimeout` and `captureAiMaxEventBytes` settings. On web, `captureAi` is a no-op and the settings have no effect. See [Capturing AI events](#capturing-ai-events). + +### Retries + +On iOS, macOS, Android, Windows and Linux: + +- The SDK retries network errors and 404, 408, 429, 500, 502, 503 and 504 responses. Other error statuses drop the events. +- When PostHog asks to retry only some events of a batch, the SDK keeps those events queued and removes the rest. +- A 413 splits the batch into smaller requests. +- After a failed send, the wait before the next one doubles from 1 second up to 30 seconds, with up to 25% random jitter. +- A `Retry-After` header pauses sending for at most 30 seconds. +- Retries have no limit. Queued events stay until they're delivered or a full queue evicts the oldest. + +### Behavior changes on Windows and Linux + +These changes are on top of the capture v1 changes above: + +- **Backoff:** a failed send used to retry 3 times, 3 seconds apart, within the same flush. It now waits for the backoff described in [Retries](#retries). +- **Request timeout:** a request fails after 10 seconds without progress, not 10 seconds in total. +- **Redirects:** a redirect that isn't followed drops the batch. Version 5 retried it. +- **`Retry-After`:** capped at 30 seconds. Version 5 had no cap. +- **Batch size:** a batch closes at `maxBatchSize` events or 5 MiB of serialized events, whichever comes first. +- **Non-finite numbers:** `NaN` and infinite property values are dropped instead of being sent as `null`. In a list, they become `null` so the other elements keep their positions. +- **Empty event names:** an event with an empty name is dropped on the device. +- **Logs:** the count of events PostHog dropped only appears in debug mode. A one-time warning about a 404 prints without debug mode, because events stay queued and nothing else reports the missing route. + +### Behavior changes on iOS and macOS + +These changes come from `posthog-ios` 4.0 and need no code changes, but they can affect your data: + +- **Malformed feature flag payloads:** a payload that is malformed JSON, empty, or only whitespace is now `null` instead of the raw string. PostHog rejects malformed payloads when you save a flag, so this rarely comes up. +- **Bootstrapped payloads:** string values in `PostHogBootstrapConfig.featureFlagPayloads`, such as `"123"` or `"true"`, now stay strings instead of being decoded to numbers or booleans. This matches Android. +- **Lifecycle events:** `Application Installed`, `Application Updated` and `Application Opened` no longer include the legacy `version` and `build` properties. Update any insights, cohorts or filters that use them to `$app_version` and `$app_build`. Android still sends `version` and `build` for now. diff --git a/contents/docs/surveys/installation/flutter.mdx b/contents/docs/surveys/installation/flutter.mdx index 7d06915a3d83..fc1e2b1e5063 100644 --- a/contents/docs/surveys/installation/flutter.mdx +++ b/contents/docs/surveys/installation/flutter.mdx @@ -17,14 +17,14 @@ import { FlutterSurveysInstallationWrapper } from "./_snippets/surveys-installat ## Limitations - On Android, requires API >= 26. -- On iOS, minimum deployment target is [iOS13](/docs/libraries/ios). +- On iOS, minimum deployment target is [iOS 15](/docs/libraries/ios). - On Web, surveys are powered by the [JavaScript Web SDK](/docs/surveys/installation/web). - Requires PostHog Flutter SDK version >= 5.8.0 (5.14.0+ recommended for latest features) ## Troubleshooting - Update your SDK and iOS Pods. -- Make sure to set the minimum platform version to iOS 13.0 in your `Podfile`, or, for Swift Package Manager projects, in the `Runner` target's **Minimum Deployments** in Xcode. +- Make sure to set the minimum platform version to iOS 15.0 in your `Podfile`, or, for Swift Package Manager projects, in the `Runner` target's **Minimum Deployments** in Xcode. - Make sure you have disabled automatic SDK initialization. - Run a clean build if you experience issues. - If surveys are not being displayed when triggered, make sure you have installed the [PosthogObserver](/docs/surveys/installation/flutter#step-two-install-posthogobserver). diff --git a/contents/tutorials/flutter-ab-tests.md b/contents/tutorials/flutter-ab-tests.md index bdc97d34c4a8..76cd4aa95107 100644 --- a/contents/tutorials/flutter-ab-tests.md +++ b/contents/tutorials/flutter-ab-tests.md @@ -114,7 +114,7 @@ To start, install [PostHog’s Flutter SDK](/docs/libraries/flutter) by adding ` dependencies: flutter: sdk: flutter - posthog_flutter: ^4.0.1 + posthog_flutter: ^6.0.0 # rest of your code ``` @@ -129,7 +129,7 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l - + @@ -137,13 +137,13 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l ``` -You'll also need to update the minimum Android SDK version to `21` in `android/app/build.gradle`: +You'll also need to update the minimum Android SDK version to `23` in `android/app/build.gradle`: ```gradle_kotlin file=android/app/build.gradle // rest of your config defaultConfig { - minSdkVersion 21 + minSdkVersion 23 // rest of your config } @@ -160,7 +160,7 @@ For iOS, you'll need to have [Cocoapods](https://guides.cocoapods.org/using/gett - com.posthog.posthog.API_KEY + com.posthog.posthog.PROJECT_TOKEN com.posthog.posthog.POSTHOG_HOST @@ -172,10 +172,10 @@ For iOS, you'll need to have [Cocoapods](https://guides.cocoapods.org/using/gett ``` -Then you need to set the minimum platform version to iOS 13.0 in your Podfile: +Then you need to set the minimum platform version to iOS 15.0 in your Podfile: ```yaml file=ios/Podfile -platform :ios, '13.0' +platform :ios, '15.0' # rest of your config ``` diff --git a/contents/tutorials/flutter-analytics.md b/contents/tutorials/flutter-analytics.md index 9a8f636c5dc0..754eb5e61cae 100644 --- a/contents/tutorials/flutter-analytics.md +++ b/contents/tutorials/flutter-analytics.md @@ -231,7 +231,7 @@ dependencies: flutter: sdk: flutter shared_preferences: ^2.2.2 - posthog_flutter: ^4.0.1 + posthog_flutter: ^6.0.0 # rest of your code ``` @@ -246,7 +246,7 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l - + @@ -254,13 +254,13 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l ``` -You'll also need to update the minimum Android SDK version to `21` in `android/app/build.gradle`: +You'll also need to update the minimum Android SDK version to `23` in `android/app/build.gradle`: ```gradle_kotlin file=android/app/build.gradle // rest of your config defaultConfig { - minSdkVersion 21 + minSdkVersion 23 // rest of your config } @@ -277,7 +277,7 @@ For iOS, you'll need to have [Cocoapods](https://guides.cocoapods.org/using/gett - com.posthog.posthog.API_KEY + com.posthog.posthog.PROJECT_TOKEN com.posthog.posthog.POSTHOG_HOST @@ -289,10 +289,10 @@ For iOS, you'll need to have [Cocoapods](https://guides.cocoapods.org/using/gett ``` -Then you need to set the minimum platform version to iOS 13.0 in your Podfile: +Then you need to set the minimum platform version to iOS 15.0 in your Podfile: ```yaml file=ios/Podfile -platform :ios, '13.0' +platform :ios, '15.0' # rest of your config ``` diff --git a/contents/tutorials/flutter-feature-flags.md b/contents/tutorials/flutter-feature-flags.md index 1eda7ba84e26..33cc83898e4f 100644 --- a/contents/tutorials/flutter-feature-flags.md +++ b/contents/tutorials/flutter-feature-flags.md @@ -110,7 +110,7 @@ To start, install [PostHog’s Flutter SDK](/docs/libraries/flutter) by adding ` dependencies: flutter: sdk: flutter - posthog_flutter: ^4.0.1 + posthog_flutter: ^6.0.0 # rest of your code ``` @@ -125,7 +125,7 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l - + @@ -133,13 +133,13 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l ``` -You'll also need to update the minimum Android SDK version to `21` in `android/app/build.gradle`: +You'll also need to update the minimum Android SDK version to `23` in `android/app/build.gradle`: ```gradle_kotlin file=android/app/build.gradle // rest of your config defaultConfig { - minSdkVersion 21 + minSdkVersion 23 // rest of your config } @@ -156,7 +156,7 @@ For iOS, you need to have [Cocoapods](https://guides.cocoapods.org/using/getting - com.posthog.posthog.API_KEY + com.posthog.posthog.PROJECT_TOKEN com.posthog.posthog.POSTHOG_HOST @@ -168,10 +168,10 @@ For iOS, you need to have [Cocoapods](https://guides.cocoapods.org/using/getting ``` -Then you need to set the minimum platform version to iOS 13.0 in your Podfile: +Then you need to set the minimum platform version to iOS 15.0 in your Podfile: ```yaml file=ios/Podfile -platform :ios, '13.0' +platform :ios, '15.0' # rest of your config ``` diff --git a/contents/tutorials/flutter-remote-config.md b/contents/tutorials/flutter-remote-config.md index 205af781d53f..1c68f9a09759 100644 --- a/contents/tutorials/flutter-remote-config.md +++ b/contents/tutorials/flutter-remote-config.md @@ -84,7 +84,7 @@ To start, install [PostHog's Flutter SDK](/docs/libraries/flutter) by adding `po dependencies: flutter: sdk: flutter - posthog_flutter: ^4.0.1 + posthog_flutter: ^6.0.0 ``` Next, we configure PostHog in each platform using our project token and instance address which you can find in [your project settings](https://us.posthog.com/settings/project). @@ -97,7 +97,7 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l - + @@ -105,11 +105,11 @@ For Android, add your PostHog configuration to your `AndroidManifest.xml` file l ``` -You'll also need to update the minimum Android SDK version to `21` in `android/app/build.gradle`: +You'll also need to update the minimum Android SDK version to `23` in `android/app/build.gradle`: ``` defaultConfig { - minSdkVersion 21 + minSdkVersion 23 // rest of your config } ``` @@ -124,7 +124,7 @@ For iOS, you need to have [Cocoapods](https://guides.cocoapods.org/using/getting - com.posthog.posthog.API_KEY + com.posthog.posthog.PROJECT_TOKEN com.posthog.posthog.POSTHOG_HOST @@ -136,10 +136,10 @@ For iOS, you need to have [Cocoapods](https://guides.cocoapods.org/using/getting ``` -Then set the minimum platform version to iOS 13.0 in your iOS Podfile: +Then set the minimum platform version to iOS 15.0 in your iOS Podfile: ```yaml -platform :ios, '13.0' +platform :ios, '15.0' # ... rest of your config ``` @@ -315,7 +315,7 @@ Finally, add the `provider` package to your `pubspec.yaml`: dependencies: flutter: sdk: flutter - posthog_flutter: ^4.0.1 + posthog_flutter: ^6.0.0 provider: ^6.1.1 ```