Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I'm using DBChooser framework for pdf preview and download from dropbox and then to upload to another server. I stuck on this part of code.
ViewController
DBChooser.default().open(for: DBChooserLinkTypeDirect, from: self, completion: { reasults in print(reasults as Any) })
DBChooser is working because dropbox is opening and then returning to the app. Hovever it is not holding direct link in directory.
let downloadURL = DBChooserResult() print(downloadURL.link)
#nil
AppDelegate
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool { if (DBChooser.default().handleOpen(url as URL!)) { return true } return false }
Any ideas what is wrong?
You appear to be constructing your own DBChooserResult object instead of using the one(s) in the results array returned by Dropbox. You should instead do something like this:
DBChooser.default().open(for: DBChooserLinkTypeDirect, from: self, completion: { results in if ((results?.count) != 0) { for case let result as DBChooserResult in results! { print(result.link) } } else { print("no results") } })
Greg, Thank you, but it is still not working. There are no errors but still result of print(result.link) is "".
for case let result as DBChooserResult in results! { print(result.link) MyVariables.fullpdfURL = String(describing: result.link)
I put some code to set my global variable and it is still "nil".
Greg thanks for response! My app is simply not handling value. I have the newest DBChooser SDK - installed via Cocoa Pods. Dropbox version is 44.2.2.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!