← Back

ofxDropBox

github.com/trentbrooks/ofxDropBox · @trentbrooks
OF 0.7 iOS Web/Networking

Openframeworks/ios addon for DropBox sdk- https://www.dropbox.com/developers/reference/sdk

12 3 Last commit 13y ago Created 14y ago

README

https://github.com/trentbrooks/ofxDropBox/raw/master/screenshot.jpg

ofxDropBox

Openframeworks/ios addon (tested with OF 0073, Xcode 4.3.1/4.4, ios 5.1/6) for the DropBox sdk- https://www.dropbox.com/developers/reference/sdk.

Example shows how to upload and download files. All uploads and downloads are queued, so you can add multiple at once.

How to setup DropBox SDK in Xcode

Original dropbox ios tutorial: https://www.dropbox.com/developers/start/setup#ios

1. create a dropbox app on https://www.dropbox.com/developers/apps 2. download the dropbox sdk: https://www.dropbox.com/developers/reference/sdk 3. add the 'Security.framework' to your OF xcode project 4. copy your dropbox app key + secret from dropbox website 5. Edit the ofxiphone-info.plist in your OF xcode project (right click open as source code) 6. If testing with the ofxDropBoxExample project. Remember to copy 'test.jpg' to your DropBox/Apps/YourApp folder otherwise the download won't work. 7. That should be it. See the example testApp to see how to connect, upload, and download using ofxDropBox.

plist code

// ofxiphone-info.plist <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>db-APP_KEY</string> </array> </dict> </array>

Sample usage

// setup ofxDropBox* dropBox = new ofxDropBox(); string appKey = "APP_KEY"; string appSecret = "APP_SECRET"; dropBox->startSession(appKey, appSecret); if(!dropBox->isAuthenticated) dropBox->linkAccount();

// download file from your dropbox to phone dropBox->downloadFile("test.jpg"); dropBox->downloadFile("blah.jpg");

// upload from phone data folder to dropbox dropBox->uploadFile("Default.png"); dropBox->uploadFile("sample.csv");

See example project for usage.

-Trent Brooks

Get this addon

HTTPS
SSH