RemoteConfigSettings.swift 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import Foundation
  2. /// Firebase Remote Config settings.
  3. @objc(FIRRemoteConfigSettings)
  4. public class RemoteConfigSettings: NSObject {
  5. /// Indicates the default value in seconds to set for the minimum interval that needs to elapse
  6. /// before a fetch request can again be made to the Remote Config backend. After a fetch request to
  7. /// the backend has succeeded, no additional fetch requests to the backend will be allowed until the
  8. /// minimum fetch interval expires. Note that you can override this default on a per-fetch request
  9. /// basis using `RemoteConfig.fetch(withExpirationDuration:)`. For example, setting
  10. /// the expiration duration to 0 in the fetch request will override the `minimumFetchInterval` and
  11. /// allow the request to proceed.
  12. ///
  13. /// The default interval is 12 hours.
  14. @objc public var minimumFetchInterval: TimeInterval
  15. /// Indicates the default value in seconds to abandon a pending fetch request made to the backend.
  16. /// This value is set for outgoing requests as the `timeoutIntervalForRequest` as well as the
  17. /// `timeoutIntervalForResource` on the `URLSession`'s configuration.
  18. ///
  19. /// The default timeout is 60 seconds.
  20. @objc public var fetchTimeout: TimeInterval
  21. /// Initializes FIRRemoteConfigSettings with default values.
  22. @objc
  23. public override init() {
  24. // Default values match the ones set in RCNConfigSettings init and FIRRemoteConfig setDefaultConfigSettings
  25. minimumFetchInterval = 43200.0 // 12 hours * 60 minutes * 60 seconds
  26. fetchTimeout = 60.0
  27. super.init()
  28. }
  29. }