cancel
Showing results for 
Search instead for 
Did you mean: 

Feature - Enable Background Sync for iOS sdk 5.1

marindragulin12
Newcomer

Hello,

We are using sdk 5.1 and we have a question regarding the feature for background sync. The help.sap.com says the following about this sync:

https://help.sap.com/viewer/fc1a59c210d848babfb3f758a6f55cb1/5.1/en-US/cc8678e3bc7343b797c2614574b05...

- Allow synchronization (upload, download) to continue running when an application is switched to the background.

- This feature creates a synchronization task in the background and completes the data transfer while the application is still in the background state.

Here is our UseCase

1- Create an update request to backend system (SAP).

2- Minimize the application (background)

When the app is minimized, the data transfer is not completed. The request is put in standby until the application come back in foreground then the request is sent to backend system.

How it suppose to work the sync when it is switched to the background?

Thanks,

Marin

former_member190800
Contributor
0 Kudos

👀 sharing to dev

Accepted Solutions (0)

Answers (1)

Answers (1)

guo-pingzhang
Advisor
Advisor

Hi marindragulin12

When the upload is triggered, the underlying OfflineOData library will do some preprocessing, upload to server wait for server response and download results and do some postprocessing afterwards. Both preprocessing and postprocessing needs CPU time.

When app is in background, it will only have few seconds CPU cycles, but that is usually enough for preprocessing if it is not finished. OfflineOData will use OS job to do network request, that will not consume CPU. After network request is finished, OS will save the result temporarily and notify the app. When the app is in foreground again, it will get notified the continue the postprocessing with the result.

So when the app is background after upload kicks off, the upload's networking part will finish in background, the real postprocessing and whole upload will finish after the app is in foreground again.

Thanks,
Guoping