0
我有以下代码加载在初始ViewController的viewDidLoad。它最初工作正常。但是它不应该每10秒寻找一次变化吗?Firebase RemoteConfig是否继续提取?
当我更新Firebase中的配置值并发布时,我在应用中看不到这一点。我在调试模式下运行,所以节流不是问题。
如果我重新启动应用程序,我会看到新的值。由于时间间隔设置为10秒,应用程序运行时不应该看到更新吗?
let rc = FIRRemoteConfig.remoteConfig()
let interval: TimeInterval = 10
FIRRemoteConfig.remoteConfig().fetch(withExpirationDuration: interval) {
(status, error) in
guard error == nil else {
//handle error here
return
}
FIRRemoteConfig.remoteConfig().activateFetched()
let test = rc["key1"].stringValue //this runs only once
}
任何想法为什么这不更新?
“expirationDuration。定义获取配置数据有多长时间的持续时间,以秒为单位”。 expirationDuration是它缓存获取数据的时间。这不是网络超时。 – user3296487