Skip to content

fix(examples): android README documents the real SDK API - #271

Open
gewenyu99 wants to merge 1 commit into
mainfrom
fix/android-readme-api
Open

gewenyu99 wants to merge 1 commit into
mainfrom
fix/android-readme-api

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

The android example README hand-wrote snippets around PostHog.getInstance() — an API that has never existed in any posthog-android version — which shipped into the integration skill's EXAMPLE.md and produced compile-breaking integrations (see wizard-workbench#2964); every snippet now mirrors the compiling example app.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gewenyu99
gewenyu99 requested a review from a team as a code owner July 22, 2026 16:43
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci revenue/stripe

Results will be posted here when complete.


// Initialize PostHog early in Application lifecycle
val config = PostHogAndroidConfig(
apiKey = BuildConfig.POSTHOG_PROJECT_TOKEN,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] main already switched this to projectToken (#425), and posthog-android 4.0 removes apiKey (PostHog/posthog-android#871), so with #479 pinning 4.0.0 this snippet won't compile. This README also conflicts with main, #418 and #479 — could we rebase and keep projectToken?

Suggested change
apiKey = BuildConfig.POSTHOG_PROJECT_TOKEN,
projectToken = BuildConfig.POSTHOG_PROJECT_TOKEN,

@johncwaters johncwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Automated review by Glimmervoid, not written by a human. Approved by hand after checking it.

  • [pr-claim-check] LOW example-apps/android/README.md:general: The description says every snippet now mirrors the compiling app, but the untouched Gradle section (lines 197-230) still shows Groovy build.gradle syntax, implementation 'com.posthog:posthog-android:3.+', and an unguarded FileInputStream on local.properties, and the project tree still names build.gradle/settings.gradle. The app uses app/build.gradle.kts with a version catalog pinning 3.31.0. Since this README ships into EXAMPLE.md, Groovy pasted into a .kts build won't compile. Consider swapping in the real Kotlin DSL from app/build.gradle.kts and gradle/libs.versions.toml.

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.

3 participants