You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Jon B.1
3 years agoCollaborator | Level 9
Background download from app extension in SwiftyDropbox
Hi -- my macOS app was working fine when I was downloading from Dropbox in the main app, but once I added download calls from my FileProvider helper app, I started getting a string of errors.
F...
- 3 years ago
Thanks for writing this up. First, for reference, can you let me know what version of SwiftyDropbox you have installed? If you're not using the latest version, currently v8.2.1, please upgrade to that and let me know if you're still seeing this issue. If so, please also share the snippet of code you're running to do the download that triggers this.
And thanks for letting us know about the issue with the documentation sidebar as well. I'll report that to the team.
Jon B.1
Collaborator | Level 9
Turns out I've been building against an old version (6.0.3); I'll upgrade to 8.2.1 and get back to you!
For what it's worth, the download code is fairly basic at this point:
logger.log("dbx_downloadWithProgress: Downloading" + filePath)
let destination: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in
return destURL
}
self.client?.files.download(path: filePath, overwrite: true, destination: destination)
.response { response, error in
if let (responseMetadata, responseURL) = response {
completionHandler(responseURL, nil)
} else if let error = error {
print(error) // TBD: error handling!
self.logger.log("dbx_downloadConfig ERROR: \(error)")
completionHandler(nil, error) // TBD: need to map the passed-in error to a file-provider one
}
}
.progress { progressData in
// TBD: need to pass in and implement progress display callback
self.logger.log("dbx_downloadConfig PROGRESS: \(progressData)")
print(progressData)
}
Jon B.1
3 years agoCollaborator | Level 9
Just want to confirm that upgrading to 8.2.1 fixed the main problem! There were additional issues with the downloaded temp files not saving and opening successfully, but those were down to a quirk of the Apple FileProvider -- it was making a "file modified" call to update a "file last used" field immediately upon opening, and I hadn't implemented that yet. But that's just unclear Apple documentation; the Dropbox code worked fine.
- Greg-DB3 years agoDropbox Staff
Thanks for following up. I'm glad to hear you got this working. I just wanted to report that we've fixed the SwiftyDropbox documentation.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,888 PostsLatest Activity: 22 seconds agoIf you need more help you can view your support options (expected response time for an email or 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!