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
ponkymar
8 years agoExplorer | Level 3
Real Example of ListFolderContinue: method in Objective-C
Can someone please provide me a real example to show how listfoldercontinue: method works with listfolder: in objective-c or in swift? I have read 100 times the description of listfoldercontinue: met...
- 8 years agoThe team just added a new sample to the README that shows how to use listFolder and listFolderContinue together:
https://github.com/dropbox/dropbox-sdk-obj-c#rpc-style-request
Hope this helps!
brduffy
6 years agoExplorer | Level 4
Here is some example Swift code based on the Objective C code. This works for me to get all of the folders and directories including shared folders and directories.
func listFolderContinueWithClient(client: DropboxClient, cursor: String) { client.files.listFolderContinue(cursor: cursor).response { response, error in if let result = response { print("entries in continue:") for entry in result.entries { //if entry.name.hasSuffix(".fm") { if let folder = entry as? Files.FolderMetadata { print("directory") print(entry.pathDisplay!) self.dropBoxDirectoryArray.append(URL(fileURLWithPath: entry.pathLower!)) }else{ //print(entry.name) print(entry.pathDisplay!) self.dropBoxFileArray.append(URL(fileURLWithPath: entry.pathLower!)) } } if result.hasMore == true { self.listFolderContinueWithClient(client: client, cursor: cursor) }else{ print("no more entries") } } else { print("Error: \(error!)") } } } // FIXME: - root controler button click @objc func onClickBarButton(sender: UIBarButtonItem) { if sender.tag == 40 { // get from dropBox print("This is Directory Array") dump(self.dropBoxDirectoryArray) print("This is File array") dump(self.dropBoxFileArray) if let client = DropboxClientsManager.authorizedClient { client.files.listFolder(path: "", recursive: true).response { response, error in if let result = response { print("Folder contents:") for entry in result.entries { //if entry.name.hasSuffix(".fm") { if let folder = entry as? Files.FolderMetadata { print("directory") print(entry.pathLower!) // check for unmounted folders with a null pathLower self.dropBoxDirectoryArray.append(URL(fileURLWithPath: entry.pathLower!)) }else{ //print(entry.name) print(entry.pathDisplay!) self.dropBoxFileArray.append(URL(fileURLWithPath: entry.pathLower!)) } } if result.hasMore == true { self.listFolderContinueWithClient(client: client, cursor: result.cursor) }else{ } } else { print("Error: \(error!)") } } }else{ var topController = UIApplication.shared.keyWindow?.rootViewController while let presentedViewController = topController!.presentedViewController { topController = presentedViewController } DropboxClientsManager.authorizeFromController(UIApplication.shared, controller: topController, openURL: { (url: URL) -> Void in UIApplication.shared.open(url, options: [:], completionHandler: nil) }) } }
- siddharth chauhan5 years agoNew member | Level 2
in recursive call shouldn't it be
self.listFolderContinueWithClient(client: client, cursor: result.cursor)
instead of this
self.listFolderContinueWithClient(client: client, cursor: cursor)
- Greg-DB5 years agoDropbox Staff
siddharth chauhan Yes, you're correct. The app should use the latest returned cursor, which would be result.cursor there.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 4 days agoIf 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!