Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase RemoteConfigSettings doesn't reflect minimumFetchInterval changes

I'm trying to change the minimumFetchInterval for my RemoteConfigSettings. I set the value to 0 but the value doesn't update. As a workaround, I can create a new RemoteConfigSettings object, set the value there, and assign the settings to the remoteConfig instance.

let remoteConfig = RemoteConfig.remoteConfig()
remoteConfig.configSettings.minimumFetchInterval = 0

Reading back minimumFetchInterval still shows the default of 43200.

The header is defined in Obj-C as: @property(nonatomic, assign) NSTimeInterval minimumFetchInterval; So I would expect the value to reflect assignments.

This does work:

remoteConfig = RemoteConfig.remoteConfig()

let configSettings = RemoteConfigSettings()
configSettings.minimumFetchInterval = 0
remoteConfig.configSettings = configSettings

I am able to work around this issue, but this should be fixed. Am I missing something, or should I continue to expect these APIs to be incorrect?

The documentation of the RemoteConfigSettings class doesn't even mention the minimumFetchInterval property, but their how to docs do.

like image 862
Michael Ozeryansky Avatar asked Dec 09 '25 09:12

Michael Ozeryansky


1 Answers

As mentioned in the link, Firebase remote config minimum fetch interval depends on 3 parameters:

  1. parameter passed in fetch(long seconds) call.

  2. The parameter in FirebaseRemoteConfigSettings.setMinimumFetchIntervalInSeconds(long seconds)

  3. Default value of 43200 seconds which is 12 hours.

When using FirebaseRemoteConfigSettings.setMinimumFetchIntervalInSeconds(long seconds)

you need to do it using "Builder" pattern & set it in FirebaseRemoteConfigSettings as

get() operation on FirebaseRemoteConfigSettings does not return the original object being used by the SDK.

Also, you can see the same in sample project provided by Firebase team here. i.e.

let settings = RemoteConfigSettings()
settings.minimumFetchInterval = 0
remoteConfig.configSettings = settings
like image 101
maveroid Avatar answered Dec 10 '25 23:12

maveroid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!