Skip to content

feat: add analytics heartbeat to iOS mobile app#808

Open
datlechin wants to merge 1 commit intomainfrom
feat/analytics-mobile-heartbeat
Open

feat: add analytics heartbeat to iOS mobile app#808
datlechin wants to merge 1 commit intomainfrom
feat/analytics-mobile-heartbeat

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Create shared TableProAnalytics module in TableProCore with protocol-based dependency injection
  • Refactor macOS AnalyticsService from 164 lines to thin wrapper (32 lines) using shared service
  • Add analytics heartbeat to iOS mobile app with 20h cooldown for foreground/background cycles
  • Add SettingsView to mobile app with privacy toggle for analytics opt-out
  • macOS now sends platform: "macos", iOS sends platform: "ios" (backend PR Structure View Refactor & Keyboard Handling Migration #24 in license repo)

Architecture

  • AnalyticsEnvironmentProvider protocol — platform-specific data injection (IOKit/UIDevice, DatabaseManager/AppState)
  • AnalyticsHeartbeatService — shared: encoding, HMAC signing, HTTP transport, heartbeat loop, cooldown
  • MacAnalyticsProvider — macOS implementation
  • IOSAnalyticsProvider — iOS implementation with stable device ID (identifierForVendor + UserDefaults persistence)

Test plan

  • macOS builds successfully
  • iOS builds successfully (CODE_SIGNING_ALLOWED=NO)
  • Run macOS app → verify heartbeat in console log after 10s
  • Run iOS app in simulator → verify heartbeat fires
  • iOS Settings → toggle analytics off → verify heartbeat skips
  • iOS background/foreground → verify no duplicate heartbeats within 20h

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.

1 participant