Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why the first time the app is installed, remote config takes time to fetch data?

I noticed that each time I re-install my app OR change iPhone’s region, the fetchAndActivate takes more time (> 5sec and even much more)

The Android version does not seem to be affected by that long delay.

Am I doing something wrong with the code below?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

private func setupRemoteConfig(completionHandler: @escaping (_ error: Error?) -> Void) {

    let remoteConfigSettings = RemoteConfigSettings()
    var fetchInterval: TimeInterval = 0

    remoteConfigSettings.minimumFetchInterval = fetchInterval
    remoteConfig.configSettings = remoteConfigSettings
    
    remoteConfig.fetchAndActivate { status, error in

        guard error == nil, status == .successFetchedFromRemote else {
            completionHandler(error)
            return
        }


        completionHandler(nil)
    }
}
```

>Solution :

While your code for setupRemoteConfig looks good on its surface, there could be other factors contributing to the long fetch time on iOS compared to Android:

  1. Throttling: Apple implements stricter throttling on network access for apps compared to Android. This means fetching remote config might take longer on iOS, especially after re-installation or region change, as the app needs to establish a new connection.

  2. Network conditions: Network conditions on the user’s device can significantly impact fetch time. Cellular data might be slower than Wi-Fi, and weak signal strength can lead to even further delays.

  3. Remote config server: The location and responsiveness of your remote config server can also play a role. Make sure your server is well-optimized and located close to your target user base.

  4. Minimum fetch interval: While you set the minimum fetch interval to 0, there might be internal caching mechanisms in iOS that delay the actual fetch for some period. Consider adjusting the interval based on your update frequency and user experience requirements.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading