cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

API v2 - Longpoll Objective C

API v2 - Longpoll Objective C

Raheel S.
Explorer | Level 3

Hello,

 

I want a good example of a using ListFolderLongpoll, I am getting cursor errors and find little documentation as to how to receive changes notification.

 

I am using ObjC SDK V2.

 

 

2 Replies 2

Greg-DB
Dropbox Staff

Hi Raheel, you can find the documentation for listFolderLongpoll itself here.

 

Using it would look like this:

 

// cursor should be the Files.ListFolderResult.cursor as retrieved by the last call to listFolderContinue
DropboxClientsManager.authorizedClient?.files.listFolderLongpoll(cursor: cursor).response(completionHandler: { (result, error) in
    if ((result) != nil) {
        if (result?.changes)! {
            // There are changes, so call listFolderContinue to retrieve them
        } else {
            // listFolderLongpoll didn't report changes, so call listFolderLongpoll again
        }
    } else if ((error) != nil) {
        // Perform whatever error handling you want here
    }
})

 

Raheel S.
Explorer | Level 3

Thanks Greg, I just figured that out. 

 

The new SDK is getting some used to.

Need more support?
Who's talking

Top contributors to this post

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