Re: iOS:Couchbase lite version 1.4.1 support background working?

2018-02-15 Thread Jens Alfke


> On Feb 14, 2018, at 6:29 AM, parvez.qure...@decurtis.com wrote:
> 
> For an iOS application using Couchbase lite v1.4.1. Does it supports 
> replication when application moves to background (by pressing home button on 
> iOS device)? If it do not support background syncing then is there any way to 
> enable it in the Couchbase lite framework? 

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.

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/974FE75E-CD75-4A67-98E7-5BD9FD2E6F36%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.


iOS:Couchbase lite version 1.4.1 support background working?

2018-02-14 Thread parvez . qureshi
For an iOS application using Couchbase lite v1.4.1. Does it supports 
replication when application moves to background (by pressing home button 
on iOS device)? If it do not support background syncing then is there any 
way to enable it in the Couchbase lite framework? 

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/020c62f6-c07d-46db-a89d-90c07ff5713e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.