Skip to content
Draft
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
9 changes: 1 addition & 8 deletions docs/onboarding/error-tracking/flutter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { OnboardingComponentsContext, createInstallation } from 'scenes/onboardi
import { getFlutterSteps as getFlutterStepsPA } from '../product-analytics/flutter'
import { StepDefinition } from '../steps'

const FLUTTER_ERROR_TRACKING_MIN_VERSION = '5.58.0'

export const getFlutterSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent } = ctx

const installSteps = getFlutterStepsPA(ctx, { minVersion: FLUTTER_ERROR_TRACKING_MIN_VERSION })
const installSteps = getFlutterStepsPA(ctx)

const exceptionAutocaptureStep: StepDefinition = {
title: 'Set up exception autocapture',
Expand All @@ -22,11 +20,6 @@ export const getFlutterSteps = (ctx: OnboardingComponentsContext): StepDefinitio
`}
</Markdown>
</CalloutBox>
<Markdown>
{dedent`
Dart AOT symbolication and background isolate listeners require \`posthog_flutter\` ${FLUTTER_ERROR_TRACKING_MIN_VERSION} or later. If your project uses an earlier version, set \`posthog_flutter: ^${FLUTTER_ERROR_TRACKING_MIN_VERSION}\` in \`pubspec.yaml\` and run \`flutter pub get\`.
`}
</Markdown>
<Markdown>
{dedent`
You can autocapture exceptions by configuring the \`errorTrackingConfig\` when setting up PostHog:
Expand Down
31 changes: 16 additions & 15 deletions docs/onboarding/product-analytics/flutter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { StepDefinition } from '../steps'
import { DEFAULT_SNIPPET_METHODS, snippetFunctions } from './_snippets/js-snippet-builder'
import { SDK_DEFAULTS_DATE } from './_snippets/sdkDefaults'

const DEFAULT_FLUTTER_SDK_VERSION = '5.24.0'
const DEFAULT_FLUTTER_SDK_VERSION = '6.0.0'

export const getFlutterInstallSteps = (
ctx: OnboardingComponentsContext,
Expand All @@ -31,6 +31,13 @@ export const getFlutterInstallSteps = (
},
]}
/>
<Markdown>posthog_flutter 6.0 requires Flutter 3.41 or later on every platform.</Markdown>
<Markdown>
If you embed Flutter in an iOS app as a module (`flutter create -t module`), use Flutter 3.50 or
later and build it with `flutter build swift-package`. Earlier Flutter versions install module
plugins with CocoaPods, and posthog_flutter 6.0 has no podspec, so stay on posthog_flutter 5.x
there.
</Markdown>
</>
),
},
Expand Down Expand Up @@ -62,7 +69,9 @@ export const getFlutterInstallSteps = (
]}
/>
<Markdown>
Update the minimum Android SDK version to **21** in `android/app/build.gradle`:
posthog_flutter needs a minimum Android SDK version of **23** or higher. New Flutter
projects default to 24, so change `android/app/build.gradle` only if your app sets a
lower value:
</Markdown>
<CodeBlock
blocks={[
Expand Down Expand Up @@ -102,19 +111,11 @@ export const getFlutterInstallSteps = (
},
]}
/>
<Markdown>Update the minimum platform version to iOS 13.0 in your `Podfile`:</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Podfile',
code: dedent`
platform :ios, '13.0'
# rest of your config
`,
},
]}
/>
<Markdown>
{dedent`
iOS and macOS builds require Xcode 26 or later. Set the minimum deployment target to iOS 15.0, or macOS 11.0 for a macOS app, in Xcode (**Runner > General > Minimum Deployments**). PostHog installs through Swift Package Manager, which is on by default from Flutter 3.44. On Flutter 3.41 to 3.43, or if you turned it off, run \`flutter config --enable-swift-package-manager\`. If you keep a \`Podfile\` for other plugins, set \`platform :ios, '15.0'\` there too (\`platform :osx, '11.0'\` in \`macos/Podfile\`), then run \`flutter build ios --config-only\` (or \`flutter build macos --config-only\`).
`}
</Markdown>
</Tab.Panel>
<Tab.Panel>
<Markdown>Add these values in `index.html`:</Markdown>
Expand Down
32 changes: 17 additions & 15 deletions docs/onboarding/session-replay/flutter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ export const getFlutterSteps = (ctx: OnboardingComponentsContext): StepDefinitio
language: 'yaml',
file: 'pubspec.yaml',
code: dedent`
posthog_flutter: ^5.24.0
posthog_flutter: ^6.0.0
`,
},
]}
/>
<Markdown>posthog_flutter 6.0 requires Flutter 3.41 or later on every platform.</Markdown>
<Markdown>
If you embed Flutter in an iOS app as a module (`flutter create -t module`), use Flutter 3.50 or
later and build it with `flutter build swift-package`. Earlier Flutter versions install module
plugins with CocoaPods, and posthog_flutter 6.0 has no podspec, so stay on posthog_flutter 5.x
there.
</Markdown>
<CalloutBox type="fyi" title="SDK version">
<Markdown>
Session replay requires PostHog Flutter SDK version 4.7.0 or higher. We recommend always
Expand Down Expand Up @@ -58,7 +65,10 @@ export const getFlutterSteps = (ctx: OnboardingComponentsContext): StepDefinitio
},
]}
/>
<Markdown>Update the minimum Android SDK version to **21** in `android/app/build.gradle`:</Markdown>
<Markdown>
posthog_flutter needs a minimum Android SDK version of **23** or higher. New Flutter projects
default to 24, so change `android/app/build.gradle` only if your app sets a lower value:
</Markdown>
<CodeBlock
blocks={[
{
Expand Down Expand Up @@ -98,19 +108,11 @@ export const getFlutterSteps = (ctx: OnboardingComponentsContext): StepDefinitio
},
]}
/>
<Markdown>Update the minimum platform version to iOS 13.0 in your `Podfile`:</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Podfile',
code: dedent`
platform :ios, '13.0'
# rest of your config
`,
},
]}
/>
<Markdown>
{dedent`
iOS and macOS builds require Xcode 26 or later. Set the minimum deployment target to iOS 15.0, or macOS 11.0 for a macOS app, in Xcode (**Runner > General > Minimum Deployments**). PostHog installs through Swift Package Manager, which is on by default from Flutter 3.44. On Flutter 3.41 to 3.43, or if you turned it off, run \`flutter config --enable-swift-package-manager\`. If you keep a \`Podfile\` for other plugins, set \`platform :ios, '15.0'\` there too (\`platform :osx, '11.0'\` in \`macos/Podfile\`), then run \`flutter build ios --config-only\` (or \`flutter build macos --config-only\`).
`}
</Markdown>
</>
),
},
Expand Down
Loading
Loading