We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
sin5
6 years agoExplorer | Level 3
I want to get a list of files in a shared folder using Objective-C SDK
I'm using Objective-c SDK v2.
I used the initWithAccessToken method of the DBTeamClient class to get an instance of the DBUserClient class.
I used the listFolders method of sharingRoutes of DBU...
- 6 years ago
If pathLower is nil, that means that the folder is not "mounted", so it doesn't have a path in that account. I recommend reading the File Access Guide and the Team Files Guide for more information on how these mechanisms work.
For reference, if you need to set the "Dropbox-API-Path-Root" header mentioned there, that's accessible via withPathRoot in the Objective-C SDK.
sin5
6 years agoExplorer | Level 3
Thank you Greg-DB.
I was able to access the files in the Dropbox Business team folder.
I got a new user client by passing the folder ID of the shared folder to the withPathRoot method of the DBUserClient class.
I am using this new user client to access files in shared folders.
The code looks like this.
DBUserClient *userClient = [teamClient userClientWithMemberId:_MY_MEMBER_ID_];
[[userClient.sharingRoutes listFolders]
setResponseBlock:^(DBSHARINGListFoldersResult * _Nullable result, DBNilObject * _Nullable routeError, DBRequestError * _Nullable networkError) {
DBSHARINGSharedFolderMetadata *entry = result.entries[0];
DBCOMMONPathRoot *pathRoot =[[DBCOMMONPathRoot alloc] initWithNamespaceId:entry.sharedFolderId];
workUserClient = [userClient withPathRoot:pathRoot];
[[workUserClient.filesRoutes listFolder:path]
setResponseBlock:^(DBFILESListFolderResult *result, DBFILESListFolderError *routeError, DBRequestError *error) {
if (result)
{
...
}
}];
}];Please point out any mistakes.
Greg-DB
Dropbox Community Moderator
6 years agoNote that you should always implement listFolderContinue in addition to listFolder to be sure you get the full listing.
- sin56 years agoExplorer | Level 3
I recognized it.
Thank you for your support.
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!