Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm successfully using UIDocumentPicker and can download and open a file in iOS.
However, If I upload a changed file to the web (via pc) and then download it again into iOS it still finds the old version. It does this for about an hour, then if I'm luck it finds the new one. Another PC with the same dropbox account syncs the file almost immediately.
Is there some sort of cache that I need to disable when using UIDocumentPicker or something else that might cause this?
Can you share the relevant code snippet(s) and a sample link so we can check on this for you? Thanks in advance!
This is the code I'm using ...
func importDatabase(view: UIViewController!, sender: AnyObject, activityIndicator: UIActivityIndicatorView) {
self.view = view
self.activityIndicator = activityIndicator
let importMenu = UIDocumentMenuViewController(documentTypes: ["com.michaeltissington.uti.awdb"], inMode: .Import)
importMenu.delegate = self
importMenu.popoverPresentationController?.barButtonItem = sender as? UIBarButtonItem
importMenu.popoverPresentationController?.sourceView = view.view
view.presentViewController(importMenu, animated: true, completion: nil)
}
func documentMenuWasCancelled(documentMenu: UIDocumentMenuViewController) {
documentMenu.dismissViewControllerAnimated(true, completion: nil)
activityIndicator.stopAnimating()
}
func documentMenu(documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
documentPicker.delegate = self
activityIndicator.startAnimating()
view.presentViewController(documentPicker, animated: true, completion: nil)
}
func documentPickerWasCancelled(controller: UIDocumentPickerViewController) {
activityIndicator.stopAnimating()
}
func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
mergeDatabase(url)
activityIndicator.stopAnimating()
let fileManager = NSFileManager.defaultManager()
try! fileManager.removeItemAtURL(url)
}
Thanks! I'm sending this along to the right people to look into it.
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!