Skip to content

chore: show capture options and captureAi in the example apps - #985

Merged
turnipdabeets merged 1 commit into
feat/v4-capture-v1from
chore/v4-example-app
Oct 28, 2026
Merged

turnipdabeets merged 1 commit into
feat/v4-capture-v1from
chore/v4-example-app

Conversation

@turnipdabeets

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Stacked on #938. The example apps already send through capture v1, since it's the SDK's only route on that branch. This PR adds examples for the two capture APIs that are new in 4.0:

  • PostHogExample (SwiftUI): a new "Capture v1" section with two buttons:
    • Capture with options calls capture(..., options: ["process_person_profile": false]).
    • Capture $ai_generation calls captureAi("$ai_generation", ...) with typical $ai_* properties and prints the returned UUID.
  • PostHogObjCExample: calls captureWithEvent:...:timestamp:options: and captureAiWithEvent:...:options:, so the example build also compiles the new Objective-C selectors.

The rest of 4.0's API changes were already in the examples: projectToken, onFeatureFlags, PostHogFeatureFlagsLoaded in reloadFeatureFlags callbacks, and the PostHogConsoleLog* renames. No example uses a removed API.

💚 How did you test it?

  • PostHogExample and PostHogObjCExample build for generic/platform=ios.
  • Ran PostHogExample on an iOS simulator: the launch $screen event was queued and sent ("capture sent successfully" in the debug log). I didn't tap the new buttons.
  • swiftformat --lint and swiftlint pass on the changed Swift file.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Built with Claude Code. Checked the example apps against the 4.0 changesets for removed APIs (none were still in use) and added coverage only for the new capture APIs. No changeset, since only the example apps changed.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@turnipdabeets turnipdabeets self-assigned this Oct 28, 2026
@turnipdabeets
turnipdabeets requested a review from a team as a code owner October 28, 2026 15:47
@turnipdabeets
turnipdabeets merged commit 1306280 into feat/v4-capture-v1 Oct 28, 2026
42 of 43 checks passed
@turnipdabeets
turnipdabeets deleted the chore/v4-example-app branch October 28, 2026 17:30
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