I just came accross this library https://github.com/mutualmobile/MMWormhole.
It's probably possible to only access the database within the app and use 
this library to send/receive documents to the Watch app.
This would solve the issue of long polling and caching but I'm not sure how 
much more code it would require.

James

On Tuesday, 27 January 2015 02:33:58 UTC, Jeff Kingyens wrote:
>
> Right now I am just polling for document changes, however the CBLDocument 
> objects appear to be cached so I can't detect changes. Is there any way to 
> wipe the cache or disable it? I am currently closing the database and 
> re-opening it every N seconds as part of my refresh/reload logic in my app 
> extension.
>
> Thanks,
> Jeff
>
> On Saturday, January 24, 2015 at 3:13:21 PM UTC-8, Jens Alfke wrote:
>>
>>
>> > On Jan 22, 2015, at 8:56 PM, Jeff Kingyens <[email protected]> 
>> wrote: 
>> > 
>> > I have an app that is starting to use extensions (today widget, watch 
>> app, etc). if the user signs up or logs in from the main ios app, whats the 
>> best way to replicate/load this database to these extensions that live in 
>> other processes? Ideally I don't need to perform push/pull replication 
>> since the network connection might not be available. These extensions are 
>> basically separate containers / sandboxes on the same device. They can 
>> share a filesystem via app group memberships. 
>>
>> I don't think replicating the database into the extension's sandbox is a 
>> good idea, since it consumes disk space and I/O bandwidth. 
>>
>> It's OK to put the database into the shared area of the filesystem and 
>> have the app and extensions all access it. The only thing you lose is that 
>> if one process changes the database, the others don't get notified; so if 
>> your UI updates are driven by notifications (or indirectly by them, via 
>> CBLLiveQuery or CBLUITableSource) they won't update to display changes from 
>> other processes. This is probably not a problem, though, because presumably 
>> the app and the extension aren't onscreen at the same time. 
>>
>> —Jens
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/743f3ca1-df25-48ea-a223-4e9ca47392f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to