Wil*_*ill 4 ios firebase swift firebase-remote-config
推送远程配置需要多长时间?我有以下代码,在网络上推送新更新后,它会继续打印 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.")
}
}
Run Code Online (Sandbox Code Playgroud)
根据文档,默认行为是缓存 12 小时。功能
fetchWithExpirationDuration(expirationDuration: NSTimeInterval, completionHandler: FIRRemoteConfigFetchCompletion?)
Run Code Online (Sandbox Code Playgroud)
指定缓存持续时间。乍一看,我认为持续时间是网络请求超时——实际上,它是缓存超时。如果您在短时间内使用它,值将在您将缓存设置为过期时重新加载。
| 归档时间: |
|
| 查看次数: |
4471 次 |
| 最近记录: |