Skip to content

chore(examples): move the mobile example apps to the new SDK majors - #479

Draft
turnipdabeets wants to merge 3 commits into
mainfrom
chore/mobile-sdk-new-majors
Draft

turnipdabeets wants to merge 3 commits into
mainfrom
chore/mobile-sdk-new-majors

Conversation

@turnipdabeets

@turnipdabeets turnipdabeets commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Don't merge until posthog-android 4.0, posthog-ios 4.0 and posthog_flutter 6.0 are all published. Until then, 4.+, from: "4.0.0" and ^6.0.0 don't resolve and the example apps don't build. Flutter 6.0 ships after the native 4.0 releases, so this PR merges on the Flutter release day.

Problem

The Android, iOS and Flutter example apps pin the current SDK majors, so they never pick up posthog-android 4.0, posthog-ios 4.0 or posthog_flutter 6.0. The source maps skill also says Flutter always uses CocoaPods, which is wrong from posthog_flutter 6.0.

Changes

  • Android: posthog goes from 3.72.1 to 4.0.0 in libs.versions.toml, and the README install line goes from 3.+ to 4.+.

  • iOS (swift): the Swift Package Manager requirement goes from up to next major from 3.56.0 to 4.0.0.

  • iOS (swift-xcodegen): from: 3.64.1 becomes from: 4.0.0 in project.yml and the README. Their comments say to stay on the project's major instead of checking for the latest release.

  • Flutter: posthog_flutter: ^6.0.0. The Runner projects target iOS 15.0 and macOS 11.0.

  • Flutter tests: the platform fake in test/mocks.dart takes the options parameter that 6.0 adds to identify, capture, captureException and screen. Without it, no test file compiles on 6.0.

  • Flutter CocoaPods: both Podfiles are deleted, because posthog_flutter 6 is a Swift package and the app has no other plugins. The README drops pod install and asks for Xcode 26 and Flutter 3.44.2, the first release that meets the app's Dart constraint with Swift Package Manager on by default.

  • error-tracking-upload-source-maps/description.md: the CocoaPods dSYM path is marked posthog-ios 3.x only. The Flutter line says 6.0 and later use the Swift Package Manager path, and 5.x uses CocoaPods.

  • commandments.yaml, two rules feat(integration): rules and agent wording per capture mode #455 doesn't touch:

    • The XcodeGen rule installs from: the detect_package_manager requirement or the installed major's x.0.0, matching the pbxproj rule in feat(integration): rules and agent wording per capture mode #455, instead of the latest release.
    • The Flutter beforeSend rule now covers both majors. On 6.x the callback gets the full native event and must be synchronous. Natively captured events need PosthogFlutterPlugin.addBeforeSend.

The other wizard rules for each major live in #455, and the frozen 3.x and 5.x pages in #454 and #471. The XcodeGen rule sits next to a line #455 rewrites, so whichever PR merges second may need a small rebase.

Not changed:

  • Package.resolved (swift) and pubspec.lock (flutter) still name the old versions. Xcode and flutter pub get re-resolve them against the new requirements, and they can be refreshed after the releases.

Open question with Eli (context-mill#454): example_paths now point to 4.0/6.0 apps while legacy variants' docs_urls point at 3.x/5.x snapshots.

Test plan

  • Flutter: with the test/mocks.dart change, flutter analyze is clean and all 13 tests pass, run against the chore/v6-posthog-ios-4 source in a scratch copy rather than a published 6.0.0.
  • commandments.yaml still loads as YAML.
  • Not built: none of the new versions is published yet. Build each app after the releases and before merging, including an iOS and macOS Flutter build without the Podfiles.
  • Not run: pnpm test, because the worktree has no installed dependencies.

LLM context

Written with Claude Code (Opus 5.5) at the request of the posthog-android maintainer, from an audit of main against the 4.0 and 6.0 release notes in PostHog/posthog.com#21807, #21808 and #20924.

🤖 Generated with Claude Code

@gewenyu99

Copy link
Copy Markdown
Collaborator

@turnipdabeets I'm gonna ask y'all hold your horses for these even after the SDK release while we do some prep work and figure out how we handle both new and old majors of these SDKs in the Wizard.

Some programs extend existing Wizard integrations, and doing a one and done replacement of the examples might really confuse the Wizard. We're thinking of doing versioned skills, so we might take this PR and base this on other changes and/or base changes on top of this.

So leave this to us to mess about and merge!

… to new majors

posthog-ios 4.x ships only through SPM; posthog_flutter 6.x needs SPM,
Flutter 3.41+ and iOS 15; @posthog/react-native-plugin 3.x needs RN 0.75+.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants