Bladeren bron

Remove paywall remote config fetch from app runtime.

Use bundled paywall config only and drop all network calls to the private Git raw endpoint in both startup and paywall presentation flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
Hussain Afzal 2 weken geleden
bovenliggende
commit
eb1f3ac03c
2 gewijzigde bestanden met toevoegingen van 0 en 34 verwijderingen
  1. 0 30
      smart_printer/PaywallConfigService.swift
  2. 0 4
      smart_printer/PaywallView.swift

+ 0 - 30
smart_printer/PaywallConfigService.swift

@@ -4,10 +4,6 @@ import Foundation
 final class PaywallConfigService {
     static let shared = PaywallConfigService()
 
-    private static let remoteConfigURL = URL(
-        string: "https://git.mqldevelopment.com/ahtasham.shahzad/smart_printer/-/raw/main/smart_printer/paywall.json"
-    )!
-
     private(set) var config: PaywallConfig
     private var hasStarted = false
 
@@ -18,32 +14,6 @@ final class PaywallConfigService {
     func start() {
         guard !hasStarted else { return }
         hasStarted = true
-        Task { await refreshFromRemote() }
-    }
-
-    func refreshFromRemote() async {
-        var request = URLRequest(url: Self.remoteConfigURL)
-        request.cachePolicy = .reloadIgnoringLocalCacheData
-        request.timeoutInterval = 15
-
-        do {
-            let (data, response) = try await URLSession.shared.data(for: request)
-            guard let http = response as? HTTPURLResponse, (200 ... 299).contains(http.statusCode) else {
-                return
-            }
-            let remoteConfig = try JSONDecoder().decode(PaywallConfig.self, from: data)
-            apply(remoteConfig)
-        } catch {
-            NSLog("Failed to refresh paywall config: \(error.localizedDescription)")
-        }
-    }
-
-    private func apply(_ remoteConfig: PaywallConfig) {
-        let bundledConfig = PaywallConfig.loadBundled()
-        let mergedConfig = bundledConfig.mergingMarketing(from: remoteConfig)
-        guard mergedConfig != config else { return }
-        config = mergedConfig
-        NotificationCenter.default.post(name: .paywallConfigDidUpdate, object: nil)
     }
 }
 

+ 0 - 4
smart_printer/PaywallView.swift

@@ -1585,10 +1585,6 @@ final class PaywallOverlayView: NSView, AppearanceRefreshable {
             refreshLoadingOverlay()
         }
 
-        Task { @MainActor in
-            await PaywallConfigService.shared.refreshFromRemote()
-            paywallView.refreshStoreState()
-        }
     }
 
     func dismiss() {