Skip to content

feat: enable captureApplicationLifecycleEvents by default and align Android config key#347

Merged
marandaneto merged 2 commits intomainfrom
feat/enable-capture-lifecycle-by-default
Mar 27, 2026
Merged

feat: enable captureApplicationLifecycleEvents by default and align Android config key#347
marandaneto merged 2 commits intomainfrom
feat/enable-capture-lifecycle-by-default

Conversation

@marandaneto
Copy link
Copy Markdown
Member

@marandaneto marandaneto commented Mar 27, 2026

💡 Motivation and Context

captureApplicationLifecycleEvents was disabled by default, requiring explicit opt-in. This changes the default to true so lifecycle events are captured out of the box.

Additionally, the Android manifest config key is aligned with iOS:

  • New key: com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS
  • Legacy key: com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS (still supported for backward compatibility)

The new key is checked first; if not present, the legacy key is used. If neither is set, defaults to true.

The changeset includes instructions on how to disable lifecycle events for users who don't want them.

💚 How did you test it?

Manual verification of manifest key resolution logic and default values on Android and iOS.

📝 Checklist

  • 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.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the release label to the PR

@marandaneto marandaneto requested a review from a team as a code owner March 27, 2026 11:39
@marandaneto
Copy link
Copy Markdown
Member Author

marandaneto commented Mar 27, 2026

android and ios are enabled by default, so i dont see a reason why not to enable by default on flutter as well

@marandaneto marandaneto enabled auto-merge (squash) March 27, 2026 11:54
@marandaneto marandaneto merged commit 5e31246 into main Mar 27, 2026
18 checks passed
@marandaneto marandaneto deleted the feat/enable-capture-lifecycle-by-default branch March 27, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants