• Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created over 13 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dropbox to iOS sync

DropboxSync is designed to keep a local folder hierarchy on iOS synced with a Dropbox folder hierarchy. The goal is to work like Dropbox on other platforms… ie the client application works with files on the file system, and they are magically synced in the background.

Operation

Unfortunately DropboxSync can't be quite as magic from an application developers perspective as Dropbox on the Desktop. In particular you are responsible for controlling the sync process through calls to enqueueFolderSyncPathRequest after you've made local changes to files in a directory, or when you want to refresh a directory from the server.

PathController maintains state on synced paths and fires notifications when those paths are modified as part of the sync process. PathController also provides a set of "Path Modifications" methods that fire those same events. The idea is that you can use those method when making your local filesystem notifications, and then your views can get a universal set of file changed notifications no matter if it's your code, or the sync code that's updating the paths.

Requirements

DropboxSync uses a slightly (DBRestClient>didParseMetadata) modified version of the Dropbox SDK that fixes a bug with wifi hotspot paywall pages.

DropboxSync uses Coredata to store local metadata used by the sync process.

Limitations

DropboxSync doesn't handle local renaming of synced folders well. Renames are synced as Delete/Add on server. For files this works, but for directories there are no checks on place to see if server directories contents have been modified, and so a local rename will just delete those files. I just disable local folder rename in my app, a better solution would be to make to the Dropboxe API Rename command.

Running Tests

Before running tests you must set your application keys and dropbox password in PathControllerTests.h. You also need to copy the DropboxTestFolderFixture (in Tests) to you Dropbox account and then update PathControllerTests.h with that path.

Basic usage

// 1. Set Dropbox shared session with keys from app using API
[DBSession setSharedSession:[[[DBSession alloc] initWithConsumerKey:CONSUMERKEY consumerSecret:CONSUMERSECRET] autorelease]];

// 2. Create path controller.
PathController *pathController = [[PathController alloc] initWithLocalRoot:LOCAL_ROOT serverRoot:SERVER_ROOT pathMetadataStorePath:METADATA_STORE];

// 3. If isn't already linked then link
if (!pathController.isLinked) {
	[pathController linkWithEmail:DROPBOX_ACCOUNT password:DROPBOX_PASSWORD];
}

// 4. Sync top level (not recursive) local root with server root.
[pathController enqueueFolderSyncPathRequest:pathController.localRoot];

More Repositories

1

quickcursor

Objective-C
497
star
2

NOTTaskPaperForIOS

Source code for the original TaskPaper for iOS.
Objective-C
492
star
3

birch-outline

Cross-platform scripting for TaskPaper
CoffeeScript
145
star
4

documents.com

Python
81
star
5

BirchOutline

Read, process, and serialize TaskPaper outlines in Swift
Swift
56
star
6

foldingtext-for-atom

Outline editor with productivity features (No longer in development)
CoffeeScript
40
star
7

letters.iphone

For toddlers with idle fingers. Letters introduces the ABC’s through a dynamic tile board that’s even fun for adults. Unlike other iPhone learning apps, Letters focuses on a fun interactive experience instead of quizzes and tests.
Objective-C
30
star
8

Documents.com.client.python

Python
27
star
9

TaskPaper

TaskPaper shared source code for TaskPaper license holders
JavaScript
20
star
10

blocks

menu
Objective-C
20
star
11

documents.com.client.javascript

JavaScript
17
star
12

BikeGuide

Bike User's Guide
16
star
13

ScriptLib

Early and in progress scripting suite for Swift apps
Swift
14
star
14

NSTextInputClient

Swift
14
star
15

foldingtext-markdown

Edit Markdown in the FoldingText for Atom outliner
JavaScript
13
star
16

SummarizedCollection

In memory positional (keyless) b+tree implementation in Swift
Swift
7
star
17

macfuseinmemory

Objective-C
6
star
18

mobydickworkout

Text how well productivity apps work with large files
6
star
19

bdocuments

Objective-C
6
star
20

PlainText.javascript

JavaScript
5
star
21

blifecycle

Objective-C
5
star
22

buserinterface

Objective-C
5
star
23

blicensemanager

Objective-C
4
star
24

bhelpbook

Perl
3
star
25

bpreferences

Objective-C
3
star
26

swift-cargo-problem

Rust
3
star
27

bscripts

Objective-C
3
star
28

bcrashreporter

Objective-C
3
star
29

systemversioncheck

Objective-C
2
star
30

bsoftwareupdate

Objective-C
2
star
31

tree-sitter-outline

C
2
star
32

bantlr

C
2
star
33

libripgrep_example

Rust
2
star
34

CloudCount

Test integrating automerge and NSDocument
Swift
2
star
35

coverwall

Objective-C
2
star
36

AutomergeStore

Swift
2
star
37

grpc_streaming_test

Rust
1
star
38

fasttext

Swift
1
star
39

Localmac.org

Find apps in your language
Python
1
star
40

NSOutlineViewReloadGroupItemTest

Swift
1
star
41

BikePath

Swift
1
star
42

Text

Simple attributed string
Swift
1
star