If the app is backgrounded while a replication is active, CBL it will request extra time from the OS to finish up. I think it can receive about 30sec.
Apps in the background aren’t in general allowed to have open sockets or initiate activities. I think newer iOS versions will allow an app to request periodic background wake-ups, as long as it doesn’t run too long. It can then can run a one-shot replication to pull the changes.
If you want to be able to pull new updates while the app is in the background, the best solution is to have your server send a push notification to the app; there is an invisible style of notification that just wakes the app up in the background, and it can pull changes as above.
(IIRC there’s an issue in 1.4.1 that requires you to manually set suspended=NO on a replication that’s initiated while in the background, else the replication will stay in the paused state.)
—Jens
Jens Alfke — Mobile Architect — Couchbase, Inc.