【问题标题】:what is the difference between setting minimum interval and settting fetch withExpirationDuration in Firebase remote config?在 Firebase 远程配置中设置最小间隔和设置 fetch withExpirationDuration 有什么区别?
【发布时间】:2020-02-21 23:54:26
【问题描述】:

here 的文档中说我必须像这样设置远程配置的设置

let settings = RemoteConfigSettings()
settings.minimumFetchInterval = 0
remoteConfig.configSettings = settings

我假设上面的代码总是用于从远程获取数据(为了避免等待 12 小时,以进行测试)。但我也发现下面的代码使用过期时间获取值

    let fetchDuration: TimeInterval = 0

    remoteConfig.fetch(withExpirationDuration: fetchDuration) { (status, error) in

        if let error = error {
            // show the error
        } else {
            // do something
        }

    }

这两者有什么区别?哪一个用于测试以避免等待 12 小时?

【问题讨论】:

    标签: ios firebase firebase-remote-config


    【解决方案1】:

    API documentation 这么说withExpirationDuration

    覆盖(默认或可选设置 minimumFetchInterval 属性 在 FIRRemoteConfigSettings) minimumFetchInterval 仅适用于当前 请求,以秒为单位。将值设置为 0 秒将强制获取 到后端。

    所以它只是覆盖了您在设置中的任何内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-08
      • 2012-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多