We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
manart
9 years agoNew member | Level 2
SwiftyDropbox Swift 3 - No error response when Internet connection is down
Hello, Before upgrading to Swift 3 (Swift 2.2), I was getting an HTTP error when the wifi of my ipad was off. Now I am not getting anything. I am using the latest version of SwiftyDropbox and apa...
manart
9 years agoNew member | Level 2
Thanks for getting back to me.
I am using IOS 10.2 - Swift 3 - Xcode 8.2.1. This is what I have:
func test(){
if let client = DropboxClientsManager.authorizedClient {
let destination: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in
let filePath = file.docsDir.appendingPathComponent("/file.xml")
return filePath
}
client.files.download(path: "/file.xml", overwrite: true, destination: destination)
.response { response, error in
if let response = response {
print(response)
} else if let error = error {
print(error)
}
}
.progress { progressData in
print(progressData)
}
}
}
When the wifi is on and internet is ok, everything works. However, if I turn the wifi off and run it again, I don't get any errors or anything. I think neither the destination and download functions are being called in this situation.
Greg-DB
Dropbox Community Moderator
9 years agoOh, I see, thanks! For upload and download calls in particular, you won't get the failure when you're offline, since those are automatically handled on a background session. (And in fact, they should automatically continue when you get back online.)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!