We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Keith B.7
10 years agoHelpful | Level 7
Trying to find some Objective-C API 1 Functionality...
Hello, I'm starting to convert my Objective-C Core API 1 code to API 1 and am having a few problems finding equivalent functionality in some areas. Because there's no language-specific transition...
- 10 years agoNo problem, and yes, the recursive parameter is also in encoded in the cursor.
Greg-DB
Dropbox Community Moderator
10 years agoHi Keith,
Thanks for the detailed writeup!
1. That's correct, while the API v2 Objective C SDK lets you cancel specific requests, it doesn't have a method for cancelling all open requests like the v1 Core SDK did. I'll pass this along as a feature request.
2. That's correct.
3. API v2 only uses OAuth 2, where the app secret is not required in client-side apps. The root parameter is also no longer necessary.
4. That's right, the API v2 getMetadata method doesn't return folder contents like the API v1 metadata method did. You should use listFolder as you mentioned. This method handles folders with many files better than the v1 metadata method did, and enables you to efficiently stay up to date with further changes, via use of the cursor and listFolderContinue.
5. Yes, building on #4, especially to better handle large listings, the contents aren't directly populated in metadata objects.
6. Correct, API v2 does make use of (sub-)classes like this, so you should use isKindOfClass to check objects.
7. Thanks for the feedback! That's correct, in API v2 root is represented as the empty string.
8. That's correct, the cursor encodes that original path.
9. There's a note about NSNumber here in the readme here.
Hope this helps!
- Keith B.710 years agoHelpful | Level 7
Hi Greg,
Great, many thanks for the thorough reply!
For (2) and (6) I'll probably write a couple of category methods to simplify those checks, then. And d'oh, I see that the -isKindOfClass: question is in fact already answered in the "Responding to edge cases" section. I'd missed that.
So, in the same vein, I understand that now, instead of having an -isDeleted flag on the meta data object, we check for the meta-data object being of the DBFILESDeletedMetadata subclass.
On (8), I assume the recursion flag is also encoded in the cursor?
On (9), I had read that note, but was curious as to why nullability needs to be represented in checks such as .hasMore at all. Not a big deal, it's just that the unconventional nature of having an -is or -has method return an NSNumber rather than a BOOL needs careful attention.
Anyway, thanks again. So far it looks as though it shouldn't be too hard to transition everything; it's just going to take some careful restructuring and browsing of the header files!
All the best,
Keith
- Greg-DB10 years ago
Dropbox Community Moderator
No problem, and yes, the recursive parameter is also in encoded in the cursor.
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!