Continious replicator not syncing in background

61 views Asked by At

we are working on implementing CBLite continuous replicator in our IOS app and one of the requirement is to support background mode. The replicator should stay active when app goes into background state and sync data.

We used BGProcessingTaskRequest to get more execution time for long running task, but it seems like replicator never completes the sync it fetches document for some time when in background and then stops syncing. It's not even printing other states like (idle, connecting,offline,Stopped).

But, if I move app from background to foreground it resumes the sync from last state and completes it. I thought BGProcessingTaskRequest can be used to complete long running task, is that not the case?

I have enabled below properties on replicator.

  • replicator.allowReplicatingInBackground = true .
  • replicator.continuous = true
  • replicator.replicatorType = "pushAndPull"
1

There are 1 answers

0
Pasin On

I'm not quite sure if BGProcessingTaskRequest can be used for extending the app to run in the background. From this doc, it seems to be fore launching and using the app in the background.

For extending the app to continue to run in the background, you may look into this doc.

I haven't worked on the iOS app for awhile so I might be wrong and outdated.