Openframeworks/ios addon for DropBox sdk- https://www.dropbox.com/developers/reference/sdk
README
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#ios1. create a dropbox app on https://www.dropbox.com/developers/apps 2. download the dropbox sdk: https://www.dropbox.com/developers/reference/sdk
- once downloaded, drag and drop the 'DropboxSDK.framework' onto your OF xcode project
- make sure you check the 'copy items into destination group's folder' checkbox.
- Under TARGETS > ofxDropBoxExample, under the 'Build Phases' tab, where it says 'Link binary with libraries', click '+' and select the 'Security.framework'.
- ref: https://www.dropbox.com/developers/start/authentication#ios
- make sure the UIApplicationExitsOnSuspend is set to false
- Add the 'plist code' below at the top after the first <dict> tag and replace 'db-APP_KEY' with your app key eg. 'db-n0vfoe7o3a5bmtz'.
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
ofxAddons