【swift】DropBoxのAPIを使用する。
DropBoxでAPIを使用する準備
- DropBoxDeveloperでappを作成
以下のページのcreate appボタンからappを開始します。
https://www.dropbox.com/developers/apps
以下の内容を入力しcreate appボタンで作成されます。
作成されたらapp keyをメモしておきましょう。
後で使用します。
Xcode設定
- Info.plistの編集
赤枠の値を入れてください
app keyもここで設定します。
- PodsでDoropBoxのライブラリを追加します。
Podfileには以下を設定します。
target 'プロジェクト名' do use_frameworks! pod 'SwiftyDropbox' end
pod installをします。
Alamofireも一緒に入りました。
>pod install Analyzing dependencies Downloading dependencies Installing Alamofire (5.4.4) Installing SwiftyDropbox (9.1.0) Generating Pods project Integrating client project Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.