func fetchConfig()

in ios/swift/FriendlyChatSwift/FCViewController.swift [92:112]


  func fetchConfig() {
    // Since the minimum fetch interval is set to zero, the next fetch will go to
    // the server unless throttling is in progress.
    // The default expiration duration is 43200 (12 hours).
    remoteConfig.fetchAndActivate() { [weak self] (status, error) in
      if status != .error {
        print("Config fetched!")
        guard let strongSelf = self else { return }
        let friendlyMsgLength = strongSelf.remoteConfig["friendly_msg_length"]
        if friendlyMsgLength.source != .static {
          strongSelf.msglength = friendlyMsgLength.numberValue!
          print("Friendly msg length config: \(strongSelf.msglength)")
        }
      } else {
        print("Config not fetched")
        if let error = error {
          print("Error \(error)")
        }
      }
    }
  }