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?
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)
}
}
```
To people who has similar issue.
From my side, the reason why it was slow to start was because of the Firebase Analytics.
By default
FirebaseApp.configurestarts the analytics if present.So, when changing the phone's region, it was probably deleting cache information and was fetching again when starting the app and for some reason, it can take some time. For sure, more than normal startup in my case.