Bläddra i källkod

Align paywall pricing display with PKR formatting and storefront settings.

This keeps the existing price points while ensuring paywall labels and StoreKit-rendered values are shown consistently in PKR for Pakistan testing.

Made-with: Cursor
huzaifahayat12 1 vecka sedan
förälder
incheckning
a823c4a6b9
2 ändrade filer med 26 tillägg och 16 borttagningar
  1. 2 2
      meetings_app/StoreKit.storekit
  2. 24 14
      meetings_app/ViewController.swift

+ 2 - 2
meetings_app/StoreKit.storekit

@@ -69,9 +69,9 @@
69 69
     "_disableDialogs" : false,
70 70
     "_failTransactionsEnabled" : false,
71 71
     "_lastSynchronizedDate" : 0,
72
-    "_locale" : "en_US",
72
+    "_locale" : "en_PK",
73 73
     "_renewalRate" : 0,
74
-    "_storefront" : "USA",
74
+    "_storefront" : "PAK",
75 75
     "_timeRate" : 0
76 76
   },
77 77
   "subscriptionGroups" : [],

+ 24 - 14
meetings_app/ViewController.swift

@@ -782,26 +782,36 @@ private extension ViewController {
782 782
         }
783 783
         let productID = PremiumStoreProduct.productID(for: plan)
784 784
         if let product = storeKitCoordinator.productsByID[productID] {
785
+            let pkrPrice = pkrDisplayPrice(product.displayPrice)
785 786
             if product.type == .nonConsumable {
786
-                return "\(product.displayPrice) one-time purchase"
787
+                return "\(pkrPrice) one-time purchase"
787 788
             }
788 789
             if let period = product.subscription?.subscriptionPeriod {
789
-                return "\(product.displayPrice)/\(subscriptionUnitText(period.unit))"
790
+                return "\(pkrPrice)/\(subscriptionUnitText(period.unit))"
790 791
             }
791
-            return product.displayPrice
792
+            return pkrPrice
792 793
         }
793 794
         switch plan {
794 795
         case .weekly:
795
-            return "Rs 1,100.00/week"
796
+            return "PKR 1,100.00/week"
796 797
         case .monthly:
797
-            return "Free for 3 Days then Rs 2,500.00/month"
798
+            return "Free for 3 Days then PKR 2,500.00/month"
798 799
         case .yearly:
799
-            return "Rs 9,900.00/year (about 190.38/week)"
800
+            return "PKR 9,900.00/year (about 190.38/week)"
800 801
         case .lifetime:
801
-            return "Rs 14,900.00 one-time purchase"
802
+            return "PKR 14,900.00 one-time purchase"
802 803
         }
803 804
     }
804 805
 
806
+    private func pkrDisplayPrice(_ value: String) -> String {
807
+        if value.hasPrefix("PKR ") { return value }
808
+        if value.hasPrefix("Rs ") {
809
+            return "PKR " + value.dropFirst(3)
810
+        }
811
+        if value.contains("PKR") { return value }
812
+        return "PKR \(value)"
813
+    }
814
+
805 815
     private func subscriptionUnitText(_ unit: Product.SubscriptionPeriod.Unit) -> String {
806 816
         switch unit {
807 817
         case .day: return "day"
@@ -825,14 +835,14 @@ private extension ViewController {
825 835
         for (plan, label) in paywallPriceLabels {
826 836
             let productID = PremiumStoreProduct.productID(for: plan)
827 837
             if let product = storeKitCoordinator.productsByID[productID] {
828
-                label.stringValue = product.displayPrice
838
+                label.stringValue = pkrDisplayPrice(product.displayPrice)
829 839
             }
830 840
         }
831 841
         for (plan, label) in paywallSubtitleLabels {
832 842
             let productID = PremiumStoreProduct.productID(for: plan)
833 843
             guard let product = storeKitCoordinator.productsByID[productID],
834 844
                   let period = product.subscription?.subscriptionPeriod else { continue }
835
-            label.stringValue = "\(product.displayPrice)/\(subscriptionUnitText(period.unit))"
845
+            label.stringValue = "\(pkrDisplayPrice(product.displayPrice))/\(subscriptionUnitText(period.unit))"
836 846
         }
837 847
         updatePaywallPlanSelection()
838 848
         updatePaywallContinueState(isLoading: false)
@@ -1512,7 +1522,7 @@ private extension ViewController {
1512 1522
 
1513 1523
         let weeklyCard = paywallPlanCard(
1514 1524
             title: "Weekly",
1515
-            price: "Rs 1,100.00",
1525
+            price: "PKR 1,100.00",
1516 1526
             badge: "Basic Deal",
1517 1527
             badgeColor: NSColor(calibratedRed: 1.0, green: 0.60, blue: 0.20, alpha: 1),
1518 1528
             subtitle: nil,
@@ -1523,7 +1533,7 @@ private extension ViewController {
1523 1533
 
1524 1534
         let monthlyCard = paywallPlanCard(
1525 1535
             title: "Monthly",
1526
-            price: "Rs 2,500.00",
1536
+            price: "PKR 2,500.00",
1527 1537
             badge: "Free Trial",
1528 1538
             badgeColor: NSColor(calibratedRed: 0.19, green: 0.82, blue: 0.39, alpha: 1),
1529 1539
             subtitle: "625.00/week",
@@ -1534,7 +1544,7 @@ private extension ViewController {
1534 1544
 
1535 1545
         let yearlyCard = paywallPlanCard(
1536 1546
             title: "Yearly",
1537
-            price: "Rs 9,900.00",
1547
+            price: "PKR 9,900.00",
1538 1548
             badge: "Best Deal",
1539 1549
             badgeColor: NSColor(calibratedRed: 1.0, green: 0.60, blue: 0.20, alpha: 1),
1540 1550
             subtitle: "190.38/week",
@@ -1545,12 +1555,12 @@ private extension ViewController {
1545 1555
 
1546 1556
         let lifetimeCard = paywallPlanCard(
1547 1557
             title: "Lifetime",
1548
-            price: "Rs 14,900.00",
1558
+            price: "PKR 14,900.00",
1549 1559
             badge: "Save 50%",
1550 1560
             badgeColor: NSColor(calibratedRed: 1.0, green: 0.60, blue: 0.20, alpha: 1),
1551 1561
             subtitle: nil,
1552 1562
             plan: .lifetime,
1553
-            strikePrice: "Rs 29,800.00"
1563
+            strikePrice: "PKR 29,800.00"
1554 1564
         )
1555 1565
         contentStack.addArrangedSubview(lifetimeCard)
1556 1566
         updatePaywallPlanSelection()