cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

One user can't see his Dropbox folders or files in my iOS app

One user can't see his Dropbox folders or files in my iOS app

hanley
Explorer | Level 3

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?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox 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.)

View solution in original post

4 Replies 4

Greg-DB
Dropbox 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.)

hanley
Explorer | 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-DB
Dropbox 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.

hanley
Explorer | Level 3

Ok. I'll give that a shot. Thanks.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    hanley Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?