PaywallModels.swift 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import Foundation
  2. enum PaywallPlan: String, CaseIterable, Identifiable {
  3. case monthly
  4. case yearly
  5. case lifetime
  6. var id: String { rawValue }
  7. var title: String {
  8. switch self {
  9. case .monthly: "Monthly"
  10. case .yearly: "Yearly"
  11. case .lifetime: "Lifetime"
  12. }
  13. }
  14. var subtitle: String {
  15. switch self {
  16. case .monthly: "Billed every month"
  17. case .yearly: "Save 42%. Billed once per year."
  18. case .lifetime: "One-time payment. All future updates."
  19. }
  20. }
  21. var productID: String {
  22. switch self {
  23. case .monthly: SubscriptionProductID.monthly
  24. case .yearly: SubscriptionProductID.yearly
  25. case .lifetime: SubscriptionProductID.lifetime
  26. }
  27. }
  28. var fallbackMainPrice: String {
  29. switch self {
  30. case .monthly: "$7.99"
  31. case .yearly: "$49.99"
  32. case .lifetime: "$79.99"
  33. }
  34. }
  35. var price: String { fallbackMainPrice }
  36. var priceSuffix: String? {
  37. switch self {
  38. case .monthly: "/mo"
  39. case .yearly: "/yr"
  40. case .lifetime: nil
  41. }
  42. }
  43. var ctaTitle: String {
  44. switch self {
  45. case .monthly: "Get Premium"
  46. case .yearly: "Get Premium"
  47. case .lifetime: "Unlock Lifetime"
  48. }
  49. }
  50. var fallbackBillingDescription: String {
  51. switch self {
  52. case .monthly:
  53. return "Billed at \(fallbackMainPrice) every month"
  54. case .yearly:
  55. return "Billed at \(fallbackMainPrice) every year"
  56. case .lifetime:
  57. return "One-time payment of \(fallbackMainPrice)"
  58. }
  59. }
  60. var isBestValue: Bool {
  61. self == .yearly
  62. }
  63. var features: [String] {
  64. switch self {
  65. case .monthly, .yearly:
  66. [
  67. "Unlimited AI Generations",
  68. "Post Generator & Title Optimizer",
  69. "Comment Writer with smart replies",
  70. ]
  71. case .lifetime:
  72. [
  73. "Pay once, use forever",
  74. "Priority Support",
  75. "Multi-device Sync",
  76. ]
  77. }
  78. }
  79. }
  80. struct PaywallFeature: Identifiable {
  81. let id = UUID()
  82. let title: String
  83. let systemImage: String
  84. }
  85. enum PaywallContent {
  86. static let title = "Unlock Full Pro Power"
  87. static let subtitle = "Generate unlimited posts, optimize titles, and craft smarter replies with advanced AI."
  88. static let includedSectionTitle = "Everything included in Premium"
  89. static let features: [PaywallFeature] = [
  90. PaywallFeature(title: "Unlimited AI Generations", systemImage: "sparkles"),
  91. PaywallFeature(title: "Post Generator", systemImage: "square.and.pencil"),
  92. PaywallFeature(title: "Title Optimizer", systemImage: "textformat.size"),
  93. PaywallFeature(title: "Comment Writer", systemImage: "bubble.left.and.bubble.right.fill"),
  94. PaywallFeature(title: "Custom AI Prompts", systemImage: "wand.and.stars"),
  95. PaywallFeature(title: "Post Analytics", systemImage: "chart.bar.fill"),
  96. ]
  97. static let continueWithFreePlan = "Continue with free plan"
  98. static let restorePurchases = "Restore Purchases"
  99. static let privacyPolicy = "Privacy Policy"
  100. static let support = "Support"
  101. static let termsOfService = "Terms of Services"
  102. }