简体   繁体   中英

Creating a shared link to file using SwiftyDropbox

Related question

While trying to use Dropbox SwiftyDropbox for creating a shared link for my file I always get the error:

Bad Input: Error in call to API function "sharing/create_shared_link": request body: could not decode input as JSON

I have created an App Folder and I can successfully write files to my Dropbox. All attempts on calling the methods in Dropbox.authorizedClient!.sharing generate this error. Does anyone have any idea to why?

This is a known issue in SwiftyDropbox 2.0.3, and I can reproduce the error output you get using 2.0.3. The same code works properly for me in 2.0.2 though. I would double check that you downgraded to 2.0.2 successfully. For example, either of these specs will give you 2.0.3:

platform :ios, '8.0'
use_frameworks!

pod 'SwiftyDropbox'

or

platform :ios, '8.0'
use_frameworks!

pod 'SwiftyDropbox', '~> 2.0.2'

Instead, you can explicitly specify 2.0.2 as such for now:

platform :ios, '8.0'
use_frameworks!

pod 'SwiftyDropbox', '2.0.2'

Then, run pod update to get that version. The output from pod update will indicate what version was used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM