iOS Subscription Features: - Complete SwiftUI subscription UI components - SubscriptionCache wrapper for accessing Kotlin state - SubscriptionHelper wrapper for limit checking - Upgrade prompt and feature comparison screens Components Created: 1. SubscriptionCache.swift - Swift wrapper for Kotlin SubscriptionCache - ObservableObject for reactive UI updates - Manages currentSubscription state 2. SubscriptionHelper.swift - Swift wrapper for Kotlin SubscriptionHelper - canAddProperty(), canAddTask() - shouldShowUpgradePromptForContractors/Documents() 3. UpgradeFeatureView.swift - Full-screen view for restricted features - Shows when free users navigate to contractors/documents - Beautiful upgrade prompt with feature icon and description - "Upgrade to Pro" button 4. UpgradePromptView.swift - Modal upgrade dialog - Shows when limits are reached (property/task limits) - Displays trigger-specific messaging - Quick feature preview - Compare plans button 5. FeatureComparisonView.swift - Free vs Pro tier comparison table - Loads feature benefits from backend - Shows all feature differences - Upgrade button 6. StoreKitManager.swift - StoreKit 2 integration (placeholder) - Product loading and purchase methods - Receipt verification hooks - Transaction observer - NOTE: Requires App Store Connect configuration Usage: - Use UpgradeFeatureView for contractors/documents screens - Use UpgradePromptView when limits are reached - SubscriptionHelper checks limits before actions Next: Integrate into contractors/documents screens 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
26 lines
1.0 KiB
Swift
26 lines
1.0 KiB
Swift
import Foundation
|
|
import ComposeApp
|
|
|
|
/// Swift wrapper for Kotlin SubscriptionHelper
|
|
class SubscriptionHelper {
|
|
static func canAddProperty() -> (allowed: Bool, triggerKey: String?) {
|
|
let result = ComposeApp.SubscriptionHelper.shared.canAddProperty()
|
|
return (result.allowed, result.triggerKey)
|
|
}
|
|
|
|
static func canAddTask() -> (allowed: Bool, triggerKey: String?) {
|
|
let result = ComposeApp.SubscriptionHelper.shared.canAddTask()
|
|
return (result.allowed, result.triggerKey)
|
|
}
|
|
|
|
static func shouldShowUpgradePromptForContractors() -> (showPrompt: Bool, triggerKey: String?) {
|
|
let result = ComposeApp.SubscriptionHelper.shared.shouldShowUpgradePromptForContractors()
|
|
return (result.allowed, result.triggerKey)
|
|
}
|
|
|
|
static func shouldShowUpgradePromptForDocuments() -> (showPrompt: Bool, triggerKey: String?) {
|
|
let result = ComposeApp.SubscriptionHelper.shared.shouldShowUpgradePromptForDocuments()
|
|
return (result.allowed, result.triggerKey)
|
|
}
|
|
}
|