There are two minimumFetchIntervalInSeconds
es in FirebaseRemoteConfig.
FirebaseRemoteConfigSettings.Builder.setMinimumFetchIntervalInSeconds(long duration)
FirebaseRemoteConfig.fetch(long minimumFetchIntervalInSeconds)
What is the exact difference between them other than the priorities explained in the document? Should I use both of them or to use either one of them is sufficient?
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings
.Builder()
.setMinimumFetchIntervalInSeconds(mCacheExpiration) // <-- (1)
.build();
mFirebaseRemoteConfig.setConfigSettingsAsync(configSettings);
mFirebaseRemoteConfig.fetch(mCacheExpiration); // <-- (2)
if you use setMinimumFetchIntervalInSeconds
you can later just call mFirebaseRemoteConfig.fetch()
without specificying an expiration. It will then use the one you specified before. See also here
fetch(long minimumFetchIntervalInSeconds)
Starts fetching configs, adhering to the specified minimum fetch interval.
fetch()
Starts fetching configs, adhering to the default minimum fetch interval.
And notice that here it does in fact say that
The default minimum fetch interval can be set with FirebaseRemoteConfigSettings.Builder#setMinimumFetchIntervalInSeconds(long)