Skip to content

feat: expose Android push capture options - #101

Merged
turnipdabeets merged 1 commit into
mainfrom
feat/android-push-capture-options
Oct 22, 2026
Merged

turnipdabeets merged 1 commit into
mainfrom
feat/android-push-capture-options

Conversation

@dustinbyrne

@dustinbyrne dustinbyrne commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Closes #100.

KMP apps cannot disable Android's automatic push-token registration or push-open capture, even when another provider owns push delivery.

  • Expose capturePushNotificationSubscriptions and capturePushNotificationOpened in PostHogConfig and forward them independently before Android setup.
  • Keep both defaults at true. These options affect Android only, with no change to current default capture behavior.
  • Retain existing constructor, copy, and deprecated apiKey factory signatures for JVM binary and Java source compatibility. Compatibility copies preserve the new options.
  • Add a minor release change intent and KDoc. The website reference update is prepared separately but still needs local preview validation before a documentation PR.

💚 How did you test it?

Using JDK 17 and the local Android SDK:

  • ./gradlew :posthog-kmp:jvmTest :posthog-kmp:testAndroidHostTest :posthog-kmp:compileKotlinJs :posthog-kmp:compileKotlinWasmJs — passed, 69 JVM tests and 51 Android host tests.
  • ./gradlew detekt — passed.
  • ./gradlew :posthog-kmp:compileKotlinIosArm64 — passed.
  • Android mapping tests cover all four switch combinations. Common tests cover defaults, copying, and the deprecated apiKey form. Java tests compile and exercise the existing constructor, factory, and copy signatures.
  • Compiled a Kotlin consumer against the base config, then ran it against the changed JVM jar without recompilation — passed. Compared public JVM descriptors for the config and companion — all existing descriptors remain.

📝 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 change to generate a change intent file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Pi using file, shell, and GitHub CLI tools, plus a fresh read-only reviewer. The review identified Java source visibility in the compatibility overloads. The final overloads remain Java-callable, with regression tests. Human review is required.

@dustinbyrne
dustinbyrne requested a review from a team as a code owner October 19, 2026 22:25
@dustinbyrne dustinbyrne self-assigned this Oct 19, 2026
@turnipdabeets
turnipdabeets merged commit a440328 into main Oct 22, 2026
23 checks passed
@turnipdabeets
turnipdabeets deleted the feat/android-push-capture-options branch October 22, 2026 16:14
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.

Expose capturePushNotificationSubscriptions / capturePushNotificationOpened in PostHogConfig (Android)

2 participants