I have already set the minimum interval to be 0 when in Debug mode. Currently what I do to fetch new data is by clearing the app storage first before launching the app.
Here is my code:
private fun initRemoteConfig() {
remoteConfig = FirebaseRemoteConfig.getInstance()
configSettings = FirebaseRemoteConfigSettings.Builder()
.setMinimumFetchIntervalInSeconds(if (BuildConfig.DEBUG) 0 else 3600)
.build()
remoteConfig.setDefaultsAsync(R.xml.remote_config_defaults)
fetch()
}
private fun fetch() {
remoteConfig.fetchAndActivate()
.addOnCompleteListener {
if (it.isSuccessful) {
val updated = it.result
Logger.d(TAG, "Config params updated: $updated. Fetch and activate succeeded") // updated = false
checkVersion()
} else {
Logger.d(TAG, "Fetch failed")
}
}
}
fetch()
with no arguments is equivalent to passing theminimumFetchIntervalInSeconds
as the argument. You can check the code for that (the override is in classConfigFetchHandler
). I think @Freighter has the correct answer here, which is simply that OP missed to actually apply theconfigSettings
object created – Travelled