Install Core API SDKs

To make things as easy as possible, we have several platform SDKs you can import into your development environment to get up and running quickly. The SDKs contain platform-specific libraries that wrap the raw HTTP calls to the Dropbox API. They are designed to shorten the distance between your application and integrating Dropbox.

iOS SDK

We've made it easy to set up the iOS SDK for Xcode by including a sample app you can use as a template. First, download and uncompress the latest version of the iOS SDK. You'll also need a recent version Xcode from the Mac App Store.

Example project

The example project we've included in the SDK contains all the libraries and presets you need to get an iOS app running without much modification. The project is called DBRoulette and contains an example of how to link an app to Dropbox and perform some simple file functions.

First, open the project DBRoulette.xcodeproj in examples/DBRoulette. Next, fill in the values for appKey, appSecret, and root with your app's key, secret, and access type in ‑[DBRouletteAppDelegate application:didFinishLaunchingWithOptions:].

Your app key is also needed in DBRoulette-Info.plist file so the app can register for the correct url scheme. To do this, find the file under the Resources group in the left pane, right-click it and select Open As → Source Code. Replace the text APP_KEY with your app's key.

Now you can build and run the app. Once running, make sure you can can start the app and login without getting errors. Once you've logged in, the app will display photos from your app's App folder or from your Dropbox's Photos folder depending on your app's access type. Once you have photos in the correct folder and DBRoulette is showing them, then you are ready to go on to the next step.

Adding to existing projects

Now that we've ensured the Dropbox SDK is working, you're ready to add it to your own project. Here's what you do:

  1. Open your project in Xcode.
  2. Navigate to where you uncompressed the SDK and drag the DropboxSDK.framework folder into your project in Xcode.
  3. Make sure Copy items into destination group's folder is selected.
  4. Press Finish button.
  5. Ensure that you have Security.framework and QuartzCore.framework added to your project. To do this, select your project file in the file explorer, select your target, and select the Build Phases sub-tab. Under Link Binary with Libraries, press the + button, select Security.framework, and press Add. Repeat for QuartzCore.framework.

Build your application. If you encounter an error, double-check the steps above. If it runs without error, you're ready to start building with the Core API.