Carthage On app launch, set minimumFetchInterval to 10 sec,
Call fetchAndActivate with a completion handler.
The first time it will always fetch from the server.
Then wait for a couple of min and re launch the app
You can see from the log
[Firebase/RemoteConfig][I-RCN000067] Successfully set configSettings. Developer Mode: false, Minimum Fetch Interval:10.000000, Fetch timeout:60.000000
[Firebase/RemoteConfig][I-RCN000051] Returning cached data.
[Firebase/RemoteConfig][I-RCN000069] Most recently fetched config is already activated.
It does not make a call to the backend to retrieve the latest Config.
The minimumFetchInterval is not taking effect.
let remoteConfig = RemoteConfig.remoteConfig()
let settings = RemoteConfigSettings()
settings.minimumFetchInterval = 10
remoteConfig.setDefaults(fromPlist: "RemoteConfigDefault")
remoteConfig.configSettings = settings
remoteConfig.fetchAndActivate(completionHandler: { (status, error) in
....
})
I found a few problems with this issue:
After some digging around I found out that setting the configSettings is an async call. If I make a call fetchAndActivate right after setting the configSettings then the minimumFetchInterval has not been take affect so the Default value is always used.
Not sure if this is considered as a bug or by design? If it is by design maybe update the documentation?
Thanks for reporting. It makes sense for configSettings to return a completion handler. Internal bug b/148652144 tracking this.
I got the same problem. Is there any workaround solution for this issue? @dmandar @yliu342
As a workaround you can call fetchwithexpirationduration: to explicitly set the minimumfetchinterval for just that fetch call.
@dmandar: fetchwithexpirationduration too has the same behavior.
The first time it will always fetch from the server, after the elapsed duration, doesn't make a call to the backend to retrieve the latest Config.
Am also experiencing the same behavior, Only the first time the remote config is fetched from the server. Even on setting minimumFetchInterval as zero, the remote config is not fetched again from remote. It is fetched from cache only. Can this be fixed on priority.
We have a fix going into Firebase 6.25.0.
I wasn't able to reproduce the issue with the fetchwithexpirationduration: API but I believe I saw an issue with it earlier in my testing, so there could also be a separate networking or backend issue unrelated to the SDK. If you have a repro case for a failure with the API with the expirationDuration parameter, please create another issue and we'll continue to investigate.
I can confirm that the issue reproduced in Firebase 6.21.0 and has been resolved in Firebase 6.25.0
This issue is still happening for us with Firebase 6.26.0.
fetchAndActivate still ignores the minimumFetchInterval value.
Most helpful comment
After some digging around I found out that setting the
configSettingsis an async call. If I make a callfetchAndActivateright after setting the configSettings then the minimumFetchInterval has not been take affect so the Default value is always used.Not sure if this is considered as a bug or by design? If it is by design maybe update the documentation?