feat: add PostHog analytics with full event tracking across app

Integrate self-hosted PostHog (SPM) with AnalyticsManager singleton wrapping
all SDK calls. Adds ~40 type-safe events covering trip planning, schedule,
progress, IAP, settings, polls, export, and share flows. Includes session
replay, autocapture, network telemetry, privacy opt-out toggle in Settings,
and super properties (app version, device, pro status, selected sports).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-02-10 15:12:16 -06:00
parent 5389fe3759
commit 2917ae22b1
20 changed files with 989 additions and 23 deletions

View File

@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
1CC750E42F148BA4007D870A /* SwiftSoup in Frameworks */ = {isa = PBXBuildFile; productRef = 1CC750E32F148BA4007D870A /* SwiftSoup */; };
1CC750E72F15A1B0007D870A /* PostHog in Frameworks */ = {isa = PBXBuildFile; productRef = 1CC750E62F15A1B0007D870A /* PostHog */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -70,6 +71,7 @@
buildActionMask = 2147483647;
files = (
1CC750E42F148BA4007D870A /* SwiftSoup in Frameworks */,
1CC750E72F15A1B0007D870A /* PostHog in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -139,6 +141,7 @@
name = SportsTime;
packageProductDependencies = (
1CC750E32F148BA4007D870A /* SwiftSoup */,
1CC750E62F15A1B0007D870A /* PostHog */,
);
productName = SportsTime;
productReference = 1CA7F8F32F0D647100490ABD /* SportsTime.app */;
@@ -224,6 +227,7 @@
minimizedProjectReferenceProxies = 1;
packageReferences = (
1CC750E12F1487A8007D870A /* XCRemoteSwiftPackageReference "SwiftSoup" */,
1CC750E52F15A1B0007D870A /* XCRemoteSwiftPackageReference "posthog-ios" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 1CA7F8F42F0D647100490ABD /* Products */;
@@ -626,6 +630,14 @@
minimumVersion = 2.11.3;
};
};
1CC750E52F15A1B0007D870A /* XCRemoteSwiftPackageReference "posthog-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/PostHog/posthog-ios.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
@@ -634,6 +646,11 @@
package = 1CC750E12F1487A8007D870A /* XCRemoteSwiftPackageReference "SwiftSoup" */;
productName = SwiftSoup;
};
1CC750E62F15A1B0007D870A /* PostHog */ = {
isa = XCSwiftPackageProductDependency;
package = 1CC750E52F15A1B0007D870A /* XCRemoteSwiftPackageReference "posthog-ios" */;
productName = PostHog;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 1CA7F8EB2F0D647100490ABD /* Project object */;