Reputation: 4270
How long does it take for a remote config to push? I have the following code, which continues to print false and the old value for at least a few minutes after pushing a new update on the web.
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.")
}
}
Upvotes: 6
Views: 10550
Reputation: 4270
The default behavior is to cache for 12 hours, according to the documentation. The function
fetchWithExpirationDuration(expirationDuration: NSTimeInterval, completionHandler: FIRRemoteConfigFetchCompletion?)
specifies the cache duration. At first glance, I thought the duration was a timeout on the network request — in fact, it's a timeout on the cache. If you use this with a short duration, the values will reload as quickly as you set the cache to expire.
Upvotes: 11