Repository navigation
feat(ios): send usage data to PostHog once the user opts in - #4058
Merged
Merged
Conversation
datlechin
enabled auto-merge (squash)
November 5, 2026 09:45
datlechin
disabled auto-merge
November 5, 2026 10:33
datlechin
enabled auto-merge (squash)
November 5, 2026 10:37
datlechin
disabled auto-merge
November 5, 2026 10:46
datlechin
enabled auto-merge (squash)
November 5, 2026 10:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/v1/analyticsreport (tablepro-clouddocs/design/clients.md, iOS).app_openedonce per local day while the app is in front, with database types and connection count;connection_attempted,connection_succeeded,first_query_executedonce per install with the database type. No identify, no person profiles.optOut()stops captures but not uploads, so an event queued offline left after opt-out, on macOS too.POSTHOG_PROJECT_KEY:Debug.xcconfigempties it, so local runs, tests, UI tests and previews of either app make no PostHog client, whateverSecrets.xcconfigsets.PrivacyInfo.xcprivacydeclares Device ID, Product Interaction, Other Usage Data, Coarse Location and Other Diagnostic Data: analytics, linked, not tracking.TableProAnalytics(only iOS used it), theAnalyticsHMACSecretplist key andANALYTICS_HMAC_SECRET.RELEASING.mdiOS steps namePOSTHOG_PROJECT_KEYand App Privacy.Needs the maintainer
apple/Configs/Secrets.xcconfigon the Mac that archives the iOS app:POSTHOG_PROJECT_KEY = <the POSTHOG_PROJECT_KEY repository secret>. Without it the Release build sends nothing; Debug builds never read it.Test plan
TelemetryTests(new, iOS): an old opt-in stays on, declined or never answered makes no client, choosing Share starts sending, no key makes no client, turning off opts out, first use while off is not sent later, background launch sends noapp_opened, once per day, once per install, heartbeat dates carry over, iOS SDK config, the transport gate, and the Debug build has no key.debugBuildHasNoProjectKeyon both apps reads the Debug test host'sInfo.plist. Before this change, the iOS Debug app built on a Mac whoseSecrets.xcconfighas the key carried it;xcodebuild -showBuildSettingsnow resolves it empty for Debug and set for Release, on both projects.verify.sh iosonTelemetryTests,OnboardingPreferencesTests,FirstRunPlanTests,AppStateLibraryTests,AcknowledgementsInventoryTests,ScenePresenterTests: 96 passed.TelemetryTestsfor the movedprojectKey(from:).check-license-inventory.py,localization.py extracted --target ios.Screenshots
First-launch question, before (the daily report) and after (PostHog):
Settings > Privacy after Don't Share, before and after: