Hi everyone,
We are developing a Native iOS app using the SAP Fiori for iOS SDK 2.0. The app is offline enabled according to the tutorials available here. However, when we execute an OData request to the backend, while the device is online, the response is very slow, even for small entity sets. I suspect that the delay is in the opening of the offline store or in the download step. Is there any setting that I am missing that slows down the online requests?
When the device is offline - the performance is much better - as expected, since it is querying the data locally. The performance is also good when performing the online request directly - without opening the offline store. The code is similar to the example found in the tutorial:
func requestEntities(completionHandler: @escaping (Error?) -> Void) {
// Only request the first 20 values. If you want to modify the requested entities, you can do it here.
deliveryServiceOffline.open { error in
guard error == nil else {
return;
}
self.appDelegate.isStoreOpened = true
self.deliveryServiceOffline.download { error in
guard error == nil else {
let query = DataQuery().selectAll().top(20)
self.deliveryServiceOffline.fetchPackages(matching: query) { packages, error in
guard let packages = packages else {
completionHandler(error!)
self.appDelegate.closeOfflineStore()
return
}
self.entities = packages
completionHandler(nil)
self.appDelegate.closeOfflineStore()
}
return
}
let query = DataQuery().selectAll().top(20)
self.deliveryService.fetchPackages(matching: query) { packages, error in
guard let packages = packages else {
completionHandler(error!)
self.appDelegate.closeOfflineStore()
return
}
self.entities = packages
completionHandler(nil)
self.appDelegate.closeOfflineStore()
}
}
}
}
If you have any ideas on why this is happening, I'd appreciate any input.
Thank you very much in advance!