Replace EventLogger with typed AnalyticsManager using PostHog
Complete analytics overhaul: delete EventLogger.swift, create Analytics.swift with typed event enum (~45 events), screen tracking, super properties (theme, icon pack, voting layout, etc.), session replay with kill switch, autocapture, and network telemetry. Replace all 99 call sites across 38 files with compiler-enforced typed events in object_action naming convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,7 @@ struct PurchaseButtonView: View {
|
||||
.background(theme.currentTheme.secondaryBGColor)
|
||||
.cornerRadius(10)
|
||||
.sheet(isPresented: $showSubscriptionStore) {
|
||||
FeelsSubscriptionStoreView()
|
||||
FeelsSubscriptionStoreView(source: "purchase_button")
|
||||
}
|
||||
.manageSubscriptionsSheet(isPresented: $showManageSubscriptions)
|
||||
}
|
||||
@@ -104,7 +104,8 @@ struct PurchaseButtonView: View {
|
||||
|
||||
private var subscriptionStatusBadge: some View {
|
||||
Group {
|
||||
if case .subscribed(_, let willAutoRenew) = iapManager.state {
|
||||
switch iapManager.state {
|
||||
case .subscribed(_, let willAutoRenew):
|
||||
if willAutoRenew {
|
||||
Text(String(localized: "subscription_status_active"))
|
||||
.font(.caption)
|
||||
@@ -122,6 +123,16 @@ struct PurchaseButtonView: View {
|
||||
.background(Color.orange)
|
||||
.cornerRadius(4)
|
||||
}
|
||||
case .billingRetry, .gracePeriod:
|
||||
Text("Payment Issue")
|
||||
.font(.caption)
|
||||
.foregroundColor(.white)
|
||||
.padding(.horizontal, 8)
|
||||
.padding(.vertical, 4)
|
||||
.background(Color.orange)
|
||||
.cornerRadius(4)
|
||||
default:
|
||||
EmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,7 +177,7 @@ struct PurchaseButtonView: View {
|
||||
// Restore purchases
|
||||
Button {
|
||||
Task {
|
||||
await iapManager.restore()
|
||||
await iapManager.restore(source: "purchase_button")
|
||||
}
|
||||
} label: {
|
||||
Text(String(localized: "purchase_view_restore"))
|
||||
|
||||
Reference in New Issue
Block a user