Dear Dropbox,
Thanks for the new obj-c API v2, looks like quite an effort! So far it's more convenient to use than API v1 and integration is going well. However, I'm a little held up on how to work with the response objects, I'm constantly looking for methods and properties on them that don't seem to be there and I think I'm misunderstanding how the union and struct object types work, the response and error objects. Here's a small example: I'm checking that a file exists, and in API v1 I hung on to the `rev` of the file, so that after I download it and modify it, I want to push it back up, and I need the rev on upload to do that without creating a new file/conflict.
According to this thread you can get the rev from the DBFILESMetadata response object in API 2:
https://www.dropboxforum.com/t5/API-support/Using-file-revs-in-API-2/m-p/191299#M8348
> In API 2, DBFILESFileMetadata has an equivalent .rev property - so far, so good.
But I'm pretty baffled as to where/how, I don't see it any such property listed for that object in the docs:
https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESMetadata.html
Here's a simple request that I think helps lay out where I'm getting confused:
[[client.filesRoutes getMetadata:path] response:^(DBFILESMetadata * _Nullable result, DBFILESGetMetadataError * _Nullable routeError, DBError * _Nullable error) {
if (result != nil) {
// File exists at that path
self.foundFile = YES;
// save the file rev
self.dropboxFileRevsion = ... ?
} else {
self.foundDatabaseFile = NO;
// But how do I check DBFILESGetMetadataError correctly for this request
// to see if it's file not found—or some other error? I can't tell from
// docs just yet
if (routError != nil) {
// the only property on routeError that seems to relate is path...
}
}
[self doNextThing];
}];Thanks for your time!