is it possible to share cbl local db to another device local db by Airdrop ?

18 views
Skip to first unread message

Tamil Selvan

unread,
Aug 23, 2017, 1:22:48 AM8/23/17
to Couchbase Mobile

Hi CBL Team,

We want to share the local database , one device to another device using Airdrop. Is it possible to do?

(Note : the idea is, we don't want to download same data from server again and again for that, get the local db(all doc) zip and share to the nearest mobile device by airdrop)

  • Version: iOS 10
  • Client OS: CBL 1.3
  • Server: CouchDB

Jens Alfke

unread,
Aug 23, 2017, 1:24:55 AM8/23/17
to mobile-c...@googlegroups.com

On Aug 22, 2017, at 10:14 PM, Tamil Selvan <tamilsel...@gmail.com> wrote:

Hi CBL Team,

We want to share the local database , one device to another device using Airdrop. Is it possible to do?

If you can copy the database bundle from another machine somehow, you can use CBLManager to install it.
(I have no idea how you'd do this with AirDrop, but I assume it's possible.)

—Jens

Brendan Duddridge

unread,
Aug 23, 2017, 2:55:47 AM8/23/17
to Couchbase Mobile
You might want to look at Multipeer Connectivity. Then zip your file and send it over to another device using:

[self.mySession sendResourceAtURL:[NSURL fileURLWithPath:zipFilePath]

withName:[selectedFileURL lastPathComponent]

toPeer:peer

withCompletionHandler:^(NSError * _Nullable error)


Where self.mySession is an MCSession object.

There's a bunch of delegates you have to implement, but it should give you a clue where to look to support sending files that way. You can also use MCNearbyServiceAdvertiser to advertise a device on the network that you want other devices to connect to. And use MCNearbyServiceBrowser to look for advertisers to connect to.


Reply all
Reply to author
Forward
0 new messages