Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Dropbox file synchronization strategy?

I am trying to sync the iPhone Documents folder with the Dropbox app folder. Is there a way to manage file deletion? For example:

  • readme.txt is created on desktop
  • readme.txt is synced to cloud
  • readme.txt is synced to iPhone

later:

  • readme.txt is deleted from desktop
  • readme.txt is deleted from cloud

Next time when iphone app starts, how can I tell whether:

  1. readme.txt is created on iPhone and should be synced to the cloud?
  2. readme.txt is deleted from cloud and should also be deleted from iPhone?
like image 474
ohho Avatar asked Dec 22 '11 02:12

ohho


1 Answers

I'm not sure whether you can directly access the Dropbox app folder on the iPhone. However, you can monitor file events with the Dropbox API, which I think was just recently released here: https://www.dropbox.com/developers

I imagine your strategy would be something like:
1. Have the user authenticate their Dropbox account
2. When the app starts up, check the files for revisions (Dropbox - REST API Reference - Revisions)
3. Update the documents folder accordingly. Note: It looks like they don't have an API for Dropbox file events, yet, at least at a glance at their API page (Events via API)

iOS SDK here: https://www.dropbox.com/developers/reference/sdk

like image 162
Roy Avatar answered Sep 29 '22 03:09

Roy