【问题标题】:How long for Firebase Remote Config to push?Firebase 远程配置推送多长时间?
【发布时间】:2016-09-19 23:28:55
【问题描述】:

远程配置推送需要多长时间?我有以下代码,在网络上推送新更新后,它会继续打印 false 和旧值至少几分钟。

remoteConfig.fetchWithCompletionHandler { (status, error) -> Void in
    if (status == FIRRemoteConfigFetchStatus.Success) {
        print("Config fetched.")
        print(self.remoteConfig.activateFetched())
        print(self.remoteConfig.configValueForKey("my_key").stringValue)
    } else {
        print("Config not fetched.")
    }
}

【问题讨论】:

  • 它应该最多显示 5 秒的新通知。 id 你的互联网连接速度很快。如果您的互联网连接速度很快,那么托管问题。

标签: ios swift firebase firebase-remote-config


【解决方案1】:

根据the documentation,默认行为是缓存 12 小时。功能

fetchWithExpirationDuration(expirationDuration: NSTimeInterval, completionHandler: FIRRemoteConfigFetchCompletion?)

指定缓存持续时间。乍一看,我认为持续时间是网络请求的超时——实际上,它是缓存的超时。如果您在很短的时间内使用它,值将在您将缓存设置为过期时重新加载。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-12
    • 1970-01-01
    相关资源
    最近更新 更多