iOS Swift: Firebase Remote Config fetch values

2.5k Views Asked by At

Is there a way or delegate to catch the updated values while the app is running without terminating the app. I am using this method to fetch the values and update.

    RemoteConfig.remoteConfig().fetch(withExpirationDuration: duration) { [weak self] (status, error) in

        guard error == nil else {
            print("Got an error fetching remote values \(error!)")
            return
        }

        print ("Retrieved values from the cloud!")

        RemoteConfig.remoteConfig().activateFetched()

        guard let strongSelf = self else { return }
        strongSelf.updateWithRomteConfigValues()

    }
1

There are 1 best solutions below

0
On

The activateFetched() call will make sure to get the latest update data (either from the defaults or the remote config) without needing to terminate the app.
I think the problem in your case come from the duration.
Try setting the duration to 0 (make sure to only do it if the developer mode is enabled )