We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Lasse Hammer P.
11 years agoNew member | Level 1
Dropbox SDK for iOS works on simulator, not on actual device
I'm making an app which relies on syncing files though Dropbox.
It works perfectly (syncs, downloads, uploads) when running on the iOS Simulator, but when I run it on my actual device I get the co...
Lasse Hammer P.
11 years agoNew member | Level 1
Hi again, I did some testing using NSFileManager. I Added this piece of code before downloading the file into the path:
if fileManager.fileExistsAtPath(localPath) {
println("File exists")
} else {
println("File does not exist")
}
On the simulator it prints "file exists", but it downloads the file to the desired location anyways, just overwriting the existing file. On my actual device it prints "file exists", but is unable to overwrite.
So i tried this:
if fileManager.fileExistsAtPath(localPath) {
println("File exists")
fileManager.removeItemAtPath(localPath, error: nil)
} else {
println("File does not exist")
}
(This code twice in a row, to check if file was removed successfully)
On simulator i get: File exists, File does not exist.
So again, simulator working as expected.
On iPhone i get: File exists, File exists. -> (so still not able to download the item).
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!