 
 class AppConfig: ObservableObject {
   @Published var colorScheme: ColorScheme
+
   init() {
     let value = RemoteConfig.remoteConfig()["color_scheme"].stringValue ?? "nil"
     colorScheme = ColorScheme(value)

  }

  #if DEBUG
    deinit {
      NotificationCenter.default.removeObserver(self)
    }
  #endif
  func updateFromRemoteConfig() {
    let remoteConfig = RemoteConfig.remoteConfig()
    remoteConfig.fetch(withExpirationDuration: 0) { status, error in
      print("Config fetch completed with status: \(status.debugDescription)")
      if let error = error {
        print("Error fetching config: \(error)")
      } else {
        remoteConfig.activate { changed, error in
          let value = remoteConfig["color_scheme"].stringValue ?? "nil"
          if changed {
            print("Remote Config changed to: \(value)")
            DispatchQueue.main.async {
              self.colorScheme = ColorScheme(value)
            }
          } else {
            print("Remote Config did not change from: \(value)")
          }
        }
      }
    }
  }

  #if swift(>=5.5)
    @available(iOS 15, *)
    func updateFromRemoteConfigAsync() async {
      let remoteConfig = RemoteConfig.remoteConfig()
      do {
        let status = try await remoteConfig.fetch(withExpirationDuration: 0)
        print("Config fetch completed with status: \(status.debugDescription)")
        do {
          let changed = try await remoteConfig.activate()
          let value = remoteConfig["color_scheme"].stringValue ?? "nil"
          if changed {
            print("Remote Config changed to: \(value)")
            DispatchQueue.main.async {
              self.colorScheme = ColorScheme(value)
            }
          } else {
            print("Remote Config did not change from: \(value)")
          }
        } catch {
          print("Error activating config: \(error)")
        }
      } catch {
        print("Error fetching config: \(error)")
      }
    }
  #endif

  }
}

extension RemoteConfigFetchAndActivateStatus {
  var debugDescription: String {
    switch self {
    case .error:
      return "error"
    case .successFetchedFromRemote:
      return "successFetchedFromRemote"
    case .successUsingPreFetchedData:
      return "successUsingPreFetchedData"
    @unknown default:
      return "unknown"
    }
