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
hanley
2 years agoExplorer | Level 3
One user can't see his Dropbox folders or files in my iOS app
My iOS app has had the Dropbox API integrated into it for several years. Our users use it to save and load files into our app.
This week one user reported that it's not showing any of their folders or files EXCEPT their "Vault" folder. He has sent screenshots of his Dropbox contents on both his Mac and iOS Dropbox App and they are all visible there. But in our app only the Vault folder is visible, nothing else. The files and folders in question are NOT inside the Vault folder.
No other users have this problem. I've had him reconnect his Dropbox account, restart the app, and unlock his vault. Nothing seems to help.
Any suggestions?
How are you listing the contents of the account? Feel free to share the relevant code snippet(s) so we can take a look.
From the description though, it sounds like you might only have listFolder and not listFolderContinue implemented and so are sometimes only retrieving a partial listing.
This functionality is paginated and you are not always guaranteed to get all of the results back in a single listFolder call, so make sure you implement support for listFolderContinue as well. Refer to the listFolder and listFolderContinue documentation for information on doing so. (Those are links to the methods in the official Dropbox API v2 Objective-C SDK, but refer to the documentation for whichever SDK you're using, if any, or the API documentation itself.)
- Greg-DBDropbox Staff
How are you listing the contents of the account? Feel free to share the relevant code snippet(s) so we can take a look.
From the description though, it sounds like you might only have listFolder and not listFolderContinue implemented and so are sometimes only retrieving a partial listing.
This functionality is paginated and you are not always guaranteed to get all of the results back in a single listFolder call, so make sure you implement support for listFolderContinue as well. Refer to the listFolder and listFolderContinue documentation for information on doing so. (Those are links to the methods in the official Dropbox API v2 Objective-C SDK, but refer to the documentation for whichever SDK you're using, if any, or the API documentation itself.)
- hanleyExplorer | Level 3
Thanks for the quick response Greg. I'm using listFolder. However, wouldn't listFolder at least show more than just the Vault? He has 11 folders, two files, and the Vault in his top-level Dropbox directory. But in our app it only shows the Vault folder.
Here's our code for displaying the contents:
for (DBFILESMetadata *entry in folder.entries) { String path = entry.pathLower; String name = entry.name; bool isFolder = [entry isKindOfClass:[DBFILESFolderMetadata class]]; if (isFolder) { items.add(new FileItemComponent(name, path, true)); } else if (name.fromLastOccurrenceOf(".", false, true) == "syn") { items.add(new FileItemComponent(name, path, false)); } } items.sort(*this); for (int i = 0; i < items.size(); i++) { addAndMakeVisible(items[i]); }
- Greg-DBDropbox Staff
The exact number of entries returned per page is not guaranteed, and can be small in some cases. The listFolder[Continue] functionality can return even just one entry per page sometimes.
There are a few factors that can affect what/how much is returned in a single call, and that can vary over time and across accounts due to a number of factors, e.g., as the state and contents of the account changes, etc, so you need to make sure you always have both listFolder and listFolderContinue implemented.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,916 PostsLatest Activity: 12 minutes ago
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 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!