Couchbase data sync background

Hi,

I am new to use of Couchbase lite iOS. I wonder to know how Couchbase lite can be able to sync data even when the iOS app pushed to background. Awaiting to appreciate your explanation.

iOS limits app activity in the background. You can either have your app request periodic wake-ups, or set up push notifications that will wake up the app and let it sync (without becoming visible.) Push notifications require work on the server side to deliver them to Apple’s servers.

Hi @jens can you give a tips or assist, how to request a periodic wake-ups in app side?

Apple has lots of documentation about background activity in apps.

Actually, I am looking Couchbase Lite work in background. Where I use continue replication but still our CBL not working in the background. There is a lack of documentation i guess. i didn’t find any related to this. If you find it. please share with us.

You asked about “periodic wake-ups”. That’s not something CBL can do; you ask iOS for that. Either periodic wakes, or you can set up your server to send push notifications through Apple’s push notification service when a client should wake up and sync.

If you’re trying to keep the replicator running after the app goes into the background, you need to set the config’s allowReplicatingInBackground property to true, and also listen for iOS backgrounding notifications and start a “background session” to give the app time to run so the replicator can finish. See Apple’s docs about that.

I will check “Periodic Wake-Ups” in Apple Docs.

For CBL work in the background, I am working as like in this link But this is in Objective - C and not working. Do you have any links which are in Swift?

ok agree with let app take its run-time. but Approx howmuch time it will take?? As it takes so long time and result gives nun. blank.

thanks.
vidmate kissanime

@itssrinadh: You would make the same API calls, just in Swift instead of Obj-C. I don’t know if we have a sample that does the same thing but in Swift.

@DyraSan: You start an iOS “background session”. When the replicator stops, you end the session. If this takes longer than the OS likes, it’ll call you back telling you to stop your session, and at that point you should stop the replicator.

You may want to check out this blog . Provides an overview and points to a tutorial on our samples page. - @jongladwin : FYI.

Thank you i will check it.