Trey t
90c3858c90
Implement StoreKit 2 purchase flow with backend verification
Fully implemented StoreKit 2 in-app purchase system:
StoreKitManager.swift:
- Product loading from App Store with Product.products() API
- Complete purchase flow with result handling (success/cancelled/pending)
- Transaction verification using VerificationResult
- Backend receipt verification via SubscriptionApi
- Automatic transaction observation with Transaction.updates
- Current entitlements checking with Transaction.currentEntitlements
- Restore purchases with AppStore.sync()
- Transaction finishing to acknowledge purchases
- Subscription cache updates after successful verification
- Error handling with custom StoreKitError enum
UpgradePromptView.swift:
- Integration with StoreKitManager singleton
- Automatic product loading on view appear
- Display of subscription options with real pricing
- Product selection with loading states
- Purchase flow with try/catch error handling
- Success alert on purchase completion
- Error message display for failed purchases
- Restore purchases button
- SubscriptionProductButton component for product display
- Annual subscription highlighted with "Save 17%" badge
- Retry loading if products fail to fetch
Key features:
- Async/await pattern throughout
- MainActor dispatching for UI updates
- Transaction cryptographic verification
- Backend verification sends transaction ID
- Purchased product IDs tracking
- Transaction listener cleanup in deinit
- Products sorted by price (monthly first)
Ready for testing with Configuration.storekit in simulator.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 13:46:33 -06:00
..
2025-11-04 09:15:49 -06:00
2025-11-24 13:46:33 -06:00
2025-11-20 23:07:37 -06:00
2025-11-21 22:56:43 -06:00
2025-11-20 23:07:29 -06:00
2025-11-24 13:09:55 -06:00
2025-11-20 23:07:14 -06:00
2025-11-10 11:45:45 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-13 22:22:52 -06:00
2025-11-15 11:18:14 -06:00
2025-11-12 20:29:42 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00
2025-11-20 23:07:14 -06:00